Tell us what’s happening:
My code is only failing the test that says that the code should pass all tests
all of the other tests are passing.
Your code so far
// #3
test('send {surname: "Colombo"}', function (done) {
chai
.request(server)
.put("/travellers")
.end(function (err, res) {
assert.equal(res.status, 200, 'response should be 200');
assert.equal(res.type, 'application/json', 'type should be application/json');
assert.equal(res.body.name, 'Cristoforo', 'body.name should be \'Cristoforo\'');
assert.equal(res.body.surname, 'Colombo', 'body.surname should be \'Colombo\'');
done();
});
});
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
.
Challenge: Run Functional Tests on an API Response using Chai-HTTP III - PUT method
Link to the challenge: