Test if an Object is an Instance of a Constructor - and related tests not passing

Tell us what’s happening:

Have been working on this section of the Curriculum all night with the kind assistance of the Discord, it comes down to syntax issues I think? I have run the code through VsCode as the Repl does not have a linting function in-built, but I can’t seem to isolate when it is passing and when it is not.

I probably have the });'s at different spots than where they should be? I can pass some of the tests in an instant and some take hours.

I believe I understand the concepts being explained here.

Your code so far

https://boilerplate-mochachai-9.tai-anan.repl.co

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36

Challenge: Test if an Object is an Instance of a Constructor

Link to the challenge:

Hello!

Are you creating a new fork of the boilerplate for every challenge? If so, the test fails because you haven’t completed it.

assert.fail does, in fact, make the test not pass (or fail), hence you should be replacing all those assert.fail with the corresponding test.

For instance, to check if a variable is not null, you would write:

let theVariable = null;

assert.isNull(theVariable);

theVariable = "This is not null";

assert.isNotNull(theVariable);

// If you uncomment the following (inside a test, of course)
// the tests would not pass because you would be expecting
// theVariable to be not null and you're explicitly setting it
// to null:

// theVariable = null;
// assert.isNotNull(theVariable)

When you run the tests, on the console is displayed something like N of M tests passed, where N is the number of tests that passed and M the total of tests run. If there are 18 tests in the 1_unit-tests.js file, then the message would be something like 0 of 18 tests passed if none passed.

Take a look at the documentation of chai, it may help further :slight_smile:

Are you creating a new fork of the boilerplate for every challenge? If so, the test fails because you haven’t completed it.

No I am not, I am just doing whatever the instructions say to do.

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