forked from danmactough/node-feedparser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotaFeed.js
38 lines (34 loc) · 1.18 KB
/
notaFeed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
describe('feedparser', function(){
var feedparser = new FeedParser({silent: true})
, feed = 'http://localhost:21337/notafeed.html';
before(function (done) {
server(done);
});
after(function (done) {
server.close(done);
});
describe('URL is not a feed', function(){
describe('#parseUrl (old API)', function(){
it('should call back with an error and no meta or articles', function(done) {
feedparser.parseUrl(feed, function (error, meta, articles) {
assert.ok(error instanceof Error);
assert.equal(error.message, 'Remote server did not respond with a feed');
assert.equal(meta, null);
assert.equal(articles, null);
done();
});
});
});
describe('.parseUrl (new API)', function(){
it('should call back with an error and no meta or articles', function(done) {
FeedParser.parseUrl(feed, function (error, meta, articles) {
assert.ok(error instanceof Error);
assert.equal(error.message, 'Remote server did not respond with a feed');
assert.equal(meta, null);
assert.equal(articles, null);
done();
});
});
});
});
});