Skip to content

Commit

Permalink
tests: add test for hello-world example
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 2, 2022
1 parent 69997cb commit a84e73b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/hello-world/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var express = require('../../');

var app = express();
var app = module.exports = express()

app.get('/', function(req, res){
res.send('Hello World');
Expand Down
21 changes: 21 additions & 0 deletions test/acceptance/hello-world.js
Original file line number Diff line number Diff line change
@@ -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)
})
})
})

0 comments on commit a84e73b

Please sign in to comment.