import supertest from 'supertest'; import should from 'should/as-function'; let server = supertest.agent('http://localhost:3000'); describe('Testing /', () => { it('returns the message object', done => { server .get('/') .expect('Content-type', /json/) .expect(200) .end(function(err, res) { should(res.statusCode).equal(200); should(res.body).be.eql({message: 'API server up and running!'}); done(); }); }); });