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

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

Используйте Хекслет по максимуму!

  • Задавайте вопросы по уроку
  • Проверяйте знания в квизах
  • Проходите практику прямо в браузере
  • Отслеживайте свой прогресс

Sign up or sign in

By sending the form, you agree to "Personal Policy" and "Service Conditions".