Problems with test

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 .

Your project link(s)

solution: https://github.com/ijll/boilerplate-mochachai-main/blob/main

Your browser information:

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

Challenge: Learn How JavaScript Assertions Work

Link to the challenge:

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.

Thanks a lot! I am new at this area and I do not understand a lot of thing. I try what you tell me but when I know how!! :slight_smile:
Thanks again!

I´ve done doing a new reply project, there were some typo and didn´t go well. Thanks again!!!

If you need help with your Replit you have to post the link to it.

But as I said, if you import your Github repo correctly the code passes the tests (for the challenge you linked to at least).

This is the console:
Unit Tests
Basic Assertions
:heavy_check_mark: #isNull, #isNotNull
:heavy_check_mark: #isDefined, #isUndefined
:heavy_check_mark: #isOk, #isNotOk
:heavy_check_mark: #isTrue, #isNotTrue
Equality
:heavy_check_mark: #equal, #notEqual
:heavy_check_mark: #strictEqual, #notStrictEqual
:heavy_check_mark: #deepEqual, #notDeepEqual
Comparisons
:heavy_check_mark: #isAbove, #isAtMost
:heavy_check_mark: #isBelow, #isAtLeast
:heavy_check_mark: #approximately
Arrays
:heavy_check_mark: #isArray, #isNotArray
:heavy_check_mark: Array #include, #notInclude (59ms)
Strings
:heavy_check_mark: #isString, #isNotString
:heavy_check_mark: String #include, #notInclude
:heavy_check_mark: #match, #notMatch
Objects
:heavy_check_mark: #property, #notProperty
:heavy_check_mark: #typeOf, #notTypeOf
:heavy_check_mark: #instanceOf, #notInstanceOf

Functional Tests
Integration tests with chai-http
:heavy_check_mark: Test GET /hello with no name (111ms)
:heavy_check_mark: Test GET /hello with your name
:heavy_check_mark: Send {surname: “Colombo”} (93ms)
:heavy_check_mark: 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

  1. 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)

  2. 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’);

  done();
});

});

Please link to your Replit.


I might as well warn you about this now.

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.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.