-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
@eliasCodes example of nock and supertest
test.only('Testing if successfully called API', (t) => {
nock('https://api.nasa.gov/planetary/apod')
.get('?date=2018-03-29&api_key=undefined')
.reply(200, { planet: 'Jupiter', photographer: 'Lawrence' });
supertest(router)
.get('/api/search?2018-03-29')
.expect(200)
.end((err, res) => {
t.deepEqual(res.body, { planet: 'Jupiter', photographer: 'Lawrence' });
t.end();
});
});