Skip to content

Make assertions throw #3201

Closed
Closed
@sindresorhus

Description

@sindresorhus

Currently, the AVA assertions don't throw. This has a lot of downsides:

  • It's surprising behavior for new users, as other test frameworks don't do it like this. (Relevant: document that ava assertions don't throw #2624)
  • It's surprising behavior for existing users too (I get surprised by it sometimes).
  • It means that you have to guard anything coming after an assertion as the execution of the test would continue even after the assertion fails. It simply complicates writing tests.
  • It means AVA cannot easily support third-party assertion frameworks.

Lets make them throw again. We can start by making it opt-in and then change the default in the next major version.


Related: #1485

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions