holepunchto / brittle

Brittle TAP test framework
Apache License 2.0
81 stars 9 forks source link

Use AssertionErrors to avoid errors getting safety-caught #40

Closed HDegroote closed 10 months ago

HDegroote commented 10 months ago

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.

mafintosh commented 10 months ago

Just make your own error class called AssertionError