Created
May 28, 2019 13:33
-
-
Save nkpremices/0e581983f6cebc4c54e36265bc77f7ae to your computer and use it in GitHub Desktop.
A testing file for the presims micro session
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
const chai = require('chai'); | |
const chaiHttp = require('chai-http'); | |
const app = require('../index'); | |
chai.use(chaiHttp); | |
describe('404 and forward to error handler', function () { | |
it('Should return an object', function(done) { | |
chai | |
.request(app) | |
.get('/') | |
.end((err, res) => { | |
res | |
.should | |
.have | |
.status(404); | |
res | |
.body | |
.should | |
.have | |
.property('errors') | |
.which | |
.has | |
.property('message', 'Not Found'); | |
done(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks fine but you could do much better by having a test case description matching exactly what you're asserting. For instance, the test case did not mention the return on an object with a message 'Not Found'.