Commit 97b86b77 authored by yPhil's avatar yPhil
Browse files

Request has left the test suite

parent cdc00fbf
This diff is collapsed.
......@@ -46,7 +46,6 @@
"devDependencies": {
"mocha": "^8.3.0",
"nyc": "^15.1.0",
"request": "^2.88.2",
"should": "^13.2.3"
}
}
......@@ -65,10 +65,10 @@ function getFeed (feedUrl, callback) {
fetch(feedUrl, {
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36',
'accept': 'text/html,application/xhtml+xml',
redirect: 'manual'
redirect: 'follow'
}).then(function (res) {
console.error('node-fetch status: %s', res.status);
console.error('node-fetch status: %s (%s)', res.status, feedUrl);
// Setup feedparser stream
var feedparser = new FeedParser();
......
const should = require('should'),
fs = require('fs'),
pjson = require('../package.json'),
request = require('request');
fetch = require('node-fetch');
describe('Pétrolette', function() {
......@@ -19,21 +19,28 @@ describe('Pétrolette', function() {
});
});
// it('Pétrolette server is running', function(done) {
// request('http://localhost:8000', { json: true }, (err, res, body) => {
// if (err) return done(err);
// res.statusCode.should.eql(200);
// done();
// });
// });
it('Pétrolette server is running', function(done) {
request('http://localhost:8000', { json: true }, (err, res, body) => {
if (err) return done(err);
res.statusCode.should.eql(200);
fetch('http://localhost:8000').then(function (res) {
res.status.should.eql(200);
done();
});
}).catch(done);
});
it('Pétrolette is returning a feed', function(done) {
request('http://localhost:8000/discover/?url=http://lemonde.fr', { json: true }, (err, res, body) => {
if (err) return done(err);
body.should.eql('https://www.lemonde.fr/rss/une.xml');
done();
});
});
// it('Pétrolette is returning a feed', function(done) {
// request('http://localhost:8000/discover/?url=http://lemonde.fr', { json: true }, (err, res, body) => {
// if (err) return done(err);
// body.should.eql('https://www.lemonde.fr/rss/une.xml');
// done();
// });
// });
// it('Pétrolette is returning a favicon', function(done) {
// request('http://localhost:8000/favicon/?url=http://lemonde.fr', { json: true }, (err, res, body) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment