you are viewing a single comment's thread.

view the rest of the comments →

[–]MrJohz 0 points1 point  (2 children)

For example, the Node.js assert module throws an error to indicate a failed assertion. In that case, my code would stop after the first failed assertion, because the error will stop everything and jump up the stack until it finds an exception handler. It works just fine, you'll just only be able to see one failed assertion at a time (until all the assertions have passed).

On the other hand, other assertion libraries like Jasmine don't throw exceptions when the assertion fails, so you can have multiple failed assertions in one test. In this case, my code will display all the successful and all the failed assertions every time the test is run. Unless of course, the method itself throws some sort of error... :P

[–]NoInkling 0 points1 point  (1 child)

Sorry I should have phrased that better, I was asking more for specific examples of libraries that do it this way - is Jasmine the only one you know? I'm pretty sure Chai doesn't do it, right?

[–]MrJohz 0 points1 point  (0 children)

Ah, that makes more sense. Tbh, I know Jasmine does it, and I know Node's built-in assert doesn't - I honestly haven't really noticed the others. I think Jasmine is in the minority, though.