avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

document that ava assertions don't throw #2624

Closed ghost closed 10 months ago

ghost commented 3 years ago

I didn't realize until recently that ava assertions don't stop the test when they fail.

I think this could be documented better, and I'm willing to do so if that's useful

novemberborn commented 3 years ago

I thought it was referenced, but I can't immediately spot it in the obvious places. This hints at it:

If multiple assertion failures are encountered within a single test, AVA will only display the first one.

(From https://github.com/avajs/ava/blob/master/docs/03-assertions.md).

That might be the best spot to add a clarification?

ghost commented 3 years ago

I'd scatter reinforcement of the idea at several places, since reference documents are often not read linearly, and "assert doesn't throw" is pretty unusual; in almost every other programming context, assert does throw.

I can make a PR in a day or so.

novemberborn commented 3 years ago

@f5lee fantastic, thank you.

earthlyreason commented 3 years ago

For reference, see also https://github.com/avajs/ava/issues/1485

novemberborn commented 10 months ago

Fixed by https://github.com/avajs/ava/pull/3246.