Tell us what’s happening:
Having issues with step 21 of 25. In the terminal on Gitpod the tests says it passes but when I input the url code in free code camp i get an error. Can you help me?
###Your project link(s)
solution: https://3000-freecodecam-boilerplate-z7ce8s54v22.ws-us116.gitpod.io
This is the 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 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/128.0.0.0 Safari/537.36 Edg/128.0.0.0
Challenge Information:
Quality Assurance and Testing with Chai - Run Functional Tests on an API Response using Chai-HTTP IV - PUT method