Open eurekaa opened 10 years ago
You can't; the assertion count only catches assertions made with the built-in jstest assertions. Counting other assertion library calls would require intercepting them somehow, probably by monkey-patching the target library.
It would be interesting to add expect
and should
libraries too, is it possible?
Maybe i can help.
The point I was making is that making jstest
count assertions from other libraries would necessarily involve monkey-patching those libraries, introducing coupling and possible breakage that doesn't sit comfortably with me. There is also a problem with the definition of 'one assertion' which can vary, e.g. jstest
considers mock expectations as assertions since those are frequently the only kind of check in tests that they appear in.
Hi, i'm using jstest with chai but if i write
jstest.Test.ASSERTION_ERRORS.push(chai.AssertionError)
i can't even get the number of assertions, which remains to 0, it just count the errors. How can i solve? Thanks.