From ab881e671747b3b1826524bb71ccb615254e3c4f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 24 Jun 2017 22:25:53 +0200 Subject: test: ensure 404s work --- test/app.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/app.test.js b/test/app.test.js index 04596fa..a054366 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -25,6 +25,14 @@ test('post', t => { .then(() => t.pass()) }) +test('post not found', t => { + return request(app.listen()) + .get('/post/non-existant') + .expect(404) + .expect(/Post not found/) + .then(() => t.pass()) +}) + test('tags', t => { return request(app.listen()) .get('/tag/a') @@ -32,3 +40,10 @@ test('tags', t => { .expect(/This is a test/) .then(() => t.pass()) }) + +test('tags not found', t => + request(app.listen()) + .get('/tag/non-existant') + .expect(404) + .expect(/tag non-existant not found/) + .then(() => t.pass())) -- cgit 1.4.1