Tell us what’s happening:
Describe your issue in detail here.
Within tests/1_unit-tests.js under the test labelled #1 in the Basic Assertions suite, change each assert to either assert.isNull or assert.isNotNull to make the test pass (should evaluate to true ). Do not alter the arguments passed to the asserts.
I do not know how to give the URL to pass the test. I upload the folder with all the modificated files with the answer and lways says:
All tests should pass.
You should choose the correct method for the first assertion - isNull vs. isNotNull .
You should choose the correct method for the second assertion - isNull vs. isNotNull .
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36 OPR/84.0.4316.42
Are you submitting the Github repo?
Because that won’t work, it has to be running on a Node/Express server.
You can just import your repo on Replit (import github.com/ijll/boilerplate-mochachai-main). Remember to click the done button if it asked you for the language and make sure it is a Node app. Or you can use the Replit starter or do it locally.
If you are in fact submitting a live server then post that link.
Edit: BTW, when I create a Replit from your repo it passes the tests.
Functional Tests
Integration tests with chai-http Test GET /hello with no name (111ms) Test GET /hello with your name Send {surname: “Colombo”} (93ms) send {surname: “da Verrazzano”}
“Famous Italian Explorers” form
1) Submit the surname “Colombo” in the HTML form
2) Submit the surname “Vespucci” in the HTML form
22 passing (469ms)
2 failing
Functional Tests
Integration tests with chai-http
“Famous Italian Explorers” form
Submit the surname “Colombo” in the HTML form:
AssertionError: assert.fail()
at Context. (tests/2_functional-tests.js:81:14)
at processImmediate (internal/timers.js:461:21)
Functional Tests
Integration tests with chai-http
“Famous Italian Explorers” form
Submit the surname “Vespucci” in the HTML form:
AssertionError: assert.fail()
at Context. (tests/2_functional-tests.js:87:14)
at processImmediate (internal/timers.js:461:21)
I do not kown if I delete some { or ( or something like that. I can´t find the error. I am doing test 4 and the response it is for test 5 I think.
This is may code for #4:
// #4
test(‘send {surname: “da Verrazzano”}’, function(done) {
/** place the chai-http request code here… /
chai
.request(server)
.put(’/travellers’)
.send({ surname: ‘da Verrazzano’ })
/ place your tests inside the callback **/
.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’);
The Zombie.js challenges are very buggy on Replit. You may have to run them locally or use a different platform (I think Glitch doesn’t have this issue but I’m not sure). They can be passed on Replit but the tests will fail very often (crash and timeout). Can’t remember if it’s just the last two or all three.