/** * Created by Martin on 08/02/2016. */ var request = require('superagent'), should=require('should'); describe('homepage', function() { it('should respond to GET', function(done) { request.get('http://localhost:3000') .end(function(err,res) { if (err) {return done(err);} should(res.status).equal(200); done(); }); }); it('should not respond to POST', function(done) { request.post('http://localhost:3000') .send({name:'Martin'}) .set('Accept','application/json') .end(function(res) { should(res.status).equal(404); done(); }); }); });