diff --git a/test/index.js b/test/index.js index b3a47ca..1b85951 100644 --- a/test/index.js +++ b/test/index.js @@ -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 \ No newline at end of file diff --git a/test/test.xml b/test/test.xml new file mode 100644 index 0000000..6ac50d6 --- /dev/null +++ b/test/test.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file