Skip to content

Commit a84e73b

Browse files
committed
tests: add test for hello-world example
1 parent 69997cb commit a84e73b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

examples/hello-world/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var express = require('../../');
22

3-
var app = express();
3+
var app = module.exports = express()
44

55
app.get('/', function(req, res){
66
res.send('Hello World');

test/acceptance/hello-world.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
var app = require('../../examples/hello-world')
3+
var request = require('supertest')
4+
5+
describe('hello-world', function () {
6+
describe('GET /', function () {
7+
it('should respond with hello world', function (done) {
8+
request(app)
9+
.get('/')
10+
.expect(200, 'Hello World', done)
11+
})
12+
})
13+
14+
describe('GET /missing', function () {
15+
it('should respond with 404', function (done) {
16+
request(app)
17+
.get('/missing')
18+
.expect(404, done)
19+
})
20+
})
21+
})

0 commit comments

Comments
 (0)