Skip to content

Commit

Permalink
add some test files
Browse files Browse the repository at this point in the history
  • Loading branch information
jindw committed May 21, 2012
1 parent 2943798 commit 3b39ccb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,19 @@ wows.describe('XML Parser').addBatch({
assert.equal(root.namespaceURI,'http://test.com')
}
}
,"file parse":{
test:function(){
var fs = require('fs');
var path = require('path')
fs.readFile(path.resolve(__dirname,'./test.xml'), 'ascii', function(err,data){
if(err) {
console.log("Could not open file"+ err);
process.exit(1);
}
var Dom = require('xmldom').DOMParser;
var doc = new Dom().parseFromString(data);
console.log(doc.childNodes[0].localName);
});
}
}
}).run(); // Run it
6 changes: 6 additions & 0 deletions test/test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


<xml>

<child></child>
</xml>

0 comments on commit 3b39ccb

Please sign in to comment.