FAQ: TDD Feature-Level Tests - Feature Test I: Assert

This community-built FAQ covers the “Feature Test I: Assert” exercise from the lesson “TDD Feature-Level Tests”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn Testing for Web Development

FAQs on the exercise Feature Test I: Assert

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Is Chai’s assert.equal() equivalent of Node’s assert module’s assert.strictEqual()?

how to run test in the terminal?

2 Likes

oh i just found out : npm test

No, assert.equal( ) uses ‘==’ for comparison whereas assert.strictEqual( ) uses ‘===’ for comparison.
For more info check : https://nodejs.org/api/assert.html

I think masakudamatsu was referring to Chai’s ‘assert.equal()’ method as mentioned in the exercise’s instructions. Fortunately for us Chai’s ‘assert.equal()’ method also asserts non-strict equality (==), much like Node’s ‘assert.equal()’.

https://www.chaijs.com/api/assert/

Chai’s assert option also has methods for ‘strict’ and ‘deep’ equality. There doesn’t seem one for ‘strictDeep’ equality though.

1 Like

thank you
i have the same doubt to how to run in the terminal

Hello please, what do I type in the bash terminal to run the test?
I have wasted so much time just trying to find out how to run the test.

Typing ‘npm test’ as @objectwhiz71086 said he found out above, did not work.

Can anyone help please?

Thanks in advance.