Tell us what’s happening:
For test #4, on my terminal it says I’ve passed the activity but on freeCodeCamp it says I haven’t completed two tasks. The forum doesn’t have any answers to this, other than the .keepOpen() update.
Any suggestions would be greatly appreciated
Here is my code:
//#4
test(‘send {surname: “da Verrazzano”}’, function (done) {
chai
.request(server)
.keepOpen()
.put('/travellers')
.send({ surname: 'da Verrazzano' })
.end(function (err, res) {
assert.equal(res.status, 200, 'response status should be 200');
assert.equal(res.type, 'application/json', 'Response status should be json');
assert.equal(res.body.name, 'Giovanni');
assert.equal(res.body.surname, 'da Verrazzano');
done();
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Challenge Information:
Quality Assurance and Testing with Chai - Run Functional Tests on an API Response using Chai-HTTP IV - PUT method