Last active
March 13, 2019 15:10
-
-
Save frankhn/3d22330cfbf93a78bb1e68f2c575c666 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').should; | |
import server from '../../app'; | |
import chaiHttp from 'chai-http'; | |
chai.use(chaiHttp); | |
describe('it should be able to apdate the article', () => { | |
it('should return the 201 status for success update', (done) => { | |
const article = { | |
title:"kacyiru", | |
body:"telecom house" | |
} | |
chai.request(server) | |
.put('/api/v1/article/1') | |
.send(article) | |
.end((err, res) => { | |
res.should.have.status(201); | |
done(); | |
}); | |
}); | |
}); |
- You have only tested the status code. you should also test values of values that are returned.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good job, man!!
But here are one thing you need to change:
1.
describe('it should be able to update an article', (req, res) => {
you don't needres
andreq
as parameters of the callback inDescribe
.