Skip to content
This repository was archived by the owner on Sep 22, 2021. It is now read-only.

Commit dbe74ce

Browse files
committed
fix(Express Tests): expect an Error when route does not exist
1 parent bb0adf1 commit dbe74ce

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/unit/test.express.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ const app = require('../../app');
2424

2525

2626
describe('express', () => {
27-
it('load home page when GET /', () => request(app).get('/').expect(200));
27+
it('load home page when GET /', () => {
28+
request(app).get('/').expect(200);
29+
});
2830

29-
it('404 when page not found', () => request(app).get('/foo/bar').expect(404));
31+
it('404 when page not found', () => {
32+
request(app)
33+
.get('/foo/bar')
34+
.expect(new Error('Not Found'));
35+
});
3036
});

0 commit comments

Comments
 (0)