Skip to content

Instantly share code, notes, and snippets.

@frankhn
Last active March 13, 2019 15:10
Show Gist options
  • Save frankhn/3d22330cfbf93a78bb1e68f2c575c666 to your computer and use it in GitHub Desktop.
Save frankhn/3d22330cfbf93a78bb1e68f2c575c666 to your computer and use it in GitHub Desktop.
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();
});
});
});
@jnkindi
Copy link

jnkindi commented Mar 13, 2019

  • 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