Question Alvi A in lesson «Testing code with other code», course «Programming fundamentals»

Alvi A

Hello! I can't understand why my solution doesn't work. Can you please explain what does this OUTPUT mean?

make: Entering directory '/usr/src/app'
suppressor pass 'RESULT=pass babel-node test.js'
suppressor fail 'RESULT=fail1 babel-node test.js'
suppressor fail 'RESULT=fail2 babel-node test.js'
suppressor fail 'RESULT=fail3 babel-node test.js'
suppressor fail 'RESULT=fail4 babel-node test.js'
#   
 Expected tests to fail, but they passed. See output above. 
Makefile:2: recipe for target 'test' failed
make: Leaving directory '/usr/src/app'
make: *** [test] Error 1

Run failed! Check and fix errors above!
2 0

R. D.

Hey Alvi!

The most important line here is Expected tests to fail, but they passed. Tests expect certain behavior from your code. If your code does what tests expect, then it passes the tests.

In this exercise, you're writing your own tests, and Hexlet's tests evaluate your tests :-) Double layer of tests! Our tests are testing your tests.

When Hexlet is testing your tests, it needs to check that they pass when needed and fail when needed. For example, if your test passes when it needs to fail, then your tests is incorrect.

All this means is that you didn't write 3 correct tests as described, I'm afraid. Make sure you write 3 working assertions.

1

Alvi A

Hey Rakhim! Oh, I've got it. Thanks for your detailed answer and wonderful course!

1

Use Hexlet to the fullest extent!

  • Ask questions about the lesson
  • Test your knowledge in quizzes
  • Practice in your browser
  • Track your progress

Sign up or sign in

By sending this form, you agree to our Personal Policy and Service Conditions

Suggested learning programs

From a novice to a developer. Get a job or your money back!

Frontend Developer icon
Profession
beginner
Development of front-end components for web applications
start anytime 10 months
Layout Designer icon
Profession
New Under development beginner
Layout with the latest CSS standards
start anytime 5 months