Last active
November 22, 2018 16:43
-
-
Save frostyblok/d834a5baac3bb25dde34d5a3d93c868e to your computer and use it in GitHub Desktop.
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
import chai from 'chai'; | |
import chaiHttp from 'chai-http'; | |
import app from '../../../server'; | |
describe('Get no article', () => { | |
it('should not get an article that does not exist', async () => { | |
const res = await chai.req(app) | |
.get('/api/v1/articles/234'); | |
expect(res.status).to.be.equal(404); | |
expect(res.body.message).to.be.deep.equals('Article not found'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I think the status in your response body (as used in your codebase) should be a text that prompts the user that the request is a failed one, not a status code.