-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated package.json with jest:test.
created defaultRoute testing. updated error-handler.js with custom msg.
- Loading branch information
Showing
3 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
const request = require('supertest'); | ||
const { app } = require('../../index'); | ||
|
||
const { defaultRouter } = require('./defaultRoute.router'); | ||
//const { defaultRouter } = require('./defaultRoute.router'); | ||
|
||
describe('tests for default route endpoint', () => { | ||
it('returns correct response to non existing route', () => { | ||
const response = { | ||
it('responds with json containing error when route does not exist', async () => { | ||
const response = await request(app).get('/default'); | ||
expect(response.statusCode).toEqual(404); | ||
expect(response.body).toEqual({ | ||
error: 'Incorrect Route' | ||
}; | ||
expect(defaultRouter).toContain(response); | ||
}); | ||
}); | ||
}); |