Question Alvi A in lesson «Testing code with other code», course «Programming fundamentals»
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!
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.
Hey Rakhim! Oh, I've got it. Thanks for your detailed answer and wonderful course!
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
From zero to a developer. Refunds in case you won't get a job