* Remove obsolete recipes
ES modules is supported out of the box.
The React recipe applies to AVA 3.
* Remove code guards against obsolete API usage
* Remove references to older AVA versions from documentation
Fixes#3201.
Assertions now throw a `TestFailure` error when they fail. This error is not exported or documented and should not be used or thrown manually. You cannot catch this error in order to recover from a failure, use `t.try()` instead.
All assertions except for `throws` and `throwsAsync` now return `true` when they pass. This is useful for some of the assertions in TypeScript where they can be used as a type guard.
Committing a failed `t.try()` result now also throws.
This removes support for @ava/babel. Since enhanced assertions (power assert)
are provided through that package this also removes support for those. Same for
improper throws detection.
@ava/babel has seen no meaningful contributions since it was released at the
start of 2020. It's not clear how we'd make it work with ESM. It's clearer if we
can recommend tools like @babel/register and otherwise focus on plain Node.js &
TypeScript support.
This affects test() and t.try().
Supporting multiple implementations made both the implementation and the
type definitions needlessly complex. Using for/of syntax it's easy
enough to declare tests (or t.try() attempts) with the same arguments.
The v3 format is encoded using CBOR. It contains all information necessary to regenerate the report file. This allows for snapshots to be updated even if tests or assertions are skipped.
This is not backwards compatible with the v2 format used in AVA 3.
Co-authored-by: Mark Wubben <mark@novemberborn.net>
Out of the box, ESM syntax will only work in Node.js 13, so having that
as the default example is misleading.
Leave it for the TypeScript recipe since TypeScript doesn't work out of
the box anyway. Leave the config example, which will be updated when we
update the config formats for ESM.
This updates code and tests to remove built-in Babel support. In the
future, it needs to be opted in to, and @ava/babel needs to be installed
besides AVA itself.
Our tests have become quite muddled, and some of them require Babel to
still be enabled, but that's all OK for now.
* Remove outdated JSPM recipe
* Update documentation to reflect the removal of built-in Babel
* Move responsibility for power-assert to @ava/babel
Extract various sections from the readme into their own files. I've tried to keep other changes to a minimum.
Remove the lone RFC. Likely, we'd reintroduce RFCs in a separate repo.