0

I am running jasmine-node and encountered something really strange. Successful tests but failures in report:

.........

Finished in 0.142 seconds
9 tests, 11 assertions, 2 failures, 0 skipped

I am using done("error") to flag a failure.

Andreas Selenwall
  • 5,705
  • 11
  • 45
  • 58

1 Answers1

0

Use done.fail(...) instead of done(...). done.fail(...) is the proper way to fail your asynchronous test.

So when my test succeeds:

done()

And when a callback is called which shouldn't be called:

done.fail("error")

This is how I check e.g. if a Promise.catch is called when it shouldn't, i.e. all callbacks that I can't spy on with SinonJS.

Andreas Selenwall
  • 5,705
  • 11
  • 45
  • 58