diff --git a/examples/hello-world/index.js b/examples/hello-world/index.js index 04382ac3d0..d82452f331 100644 --- a/examples/hello-world/index.js +++ b/examples/hello-world/index.js @@ -1,6 +1,6 @@ var express = require('../../'); -var app = express(); +var app = module.exports = express() app.get('/', function(req, res){ res.send('Hello World'); diff --git a/test/acceptance/hello-world.js b/test/acceptance/hello-world.js new file mode 100644 index 0000000000..db90349c49 --- /dev/null +++ b/test/acceptance/hello-world.js @@ -0,0 +1,21 @@ + +var app = require('../../examples/hello-world') +var request = require('supertest') + +describe('hello-world', function () { + describe('GET /', function () { + it('should respond with hello world', function (done) { + request(app) + .get('/') + .expect(200, 'Hello World', done) + }) + }) + + describe('GET /missing', function () { + it('should respond with 404', function (done) { + request(app) + .get('/missing') + .expect(404, done) + }) + }) +})