The added test illustrates the relevance, with a case where a normal 'Assertion after end' error gets swallowed and the test passes even though it should fail (fixed with this PR)
Note: this will not work for browser code, as when assert does not exist, normal errors will still be thrown. I indicated this with a TODO, as that was already broken beforehand and this PR at least fixes the Node case.
The added test illustrates the relevance, with a case where a normal 'Assertion after end' error gets swallowed and the test passes even though it should fail (fixed with this PR)
Note: this will not work for browser code, as when
assert
does not exist, normal errors will still be thrown. I indicated this with a TODO, as that was already broken beforehand and this PR at least fixes the Node case.