node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+48
View File
@@ -0,0 +1,48 @@
var needle = require('./..'),
should = require('should'),
xml2js_present;
try {
require('xml2js');
xml2js_present = true;
} catch(e) {
xml2js_present = false;
}
describe('parsing', function() {
var url, opts = {};
if (!xml2js_present)
return;
describe('when xml2js is present', function(){
describe('and parse option is true', function(){
before(function() {
opts.parse = true;
})
describe('and a valid XML is requested', function(){
url = 'https://news.ycombinator.com/rss';
it('parses it', function(done) {
needle.get(url, opts, function(err, resp, body){
resp.statusCode.should.equal(200);
should.exist(resp.body.rss);
done();
})
});
});
});
});
})