Fixes#3373. The idle guard will now force a test worker to exit even if it's continuously writing to stdout/stderr.
Co-authored-by: Mark Wubben <mark@novemberborn.net>
This filter function can be used to remove node arguments that may be applied to the main process, but cannot be used to start worker threads. It can only be configured in a JavaScript configuration file. It does not apply when using child processes.
Co-authored-by: Tommy <tmitchell7@uh.edu>
Co-authored-by: Mark Wubben <mark@novemberborn.net>
* Upgrade XO
* Update TypeScript-related dependencies — Don't upgrade @sindresorhus/tsconfig to v6 since it requires TS 5.5 and we test with 5.2.
* Update dev dependencies
* Update dependencies
* Rebuild lockfile
* Upgrade CodeCov action
* Update reporter log instructions and remove deprecation warnings
* Make Node.js 22.6 the recommended development version
* Remove Node.js 21 from the engines list: It's no longer maintained by Node.js itself, see also <https://github.com/avajs/ava/blob/main/docs/support-statement.md>.
* Upgrade xo to v0.57.0 and lint sources, tests, and examples
Disabled `unicorn/prevent-abbreviations` because it introduces too many
opinionated changes.
* Update reporter logs which are sensitive to line numbers changing
---------
Co-authored-by: Mark Wubben <mark@novemberborn.net>
The counters used absolute paths for the test files, but the clearing logic used relative paths. Count using relative paths instead.
The number of previous failures is not observable to the test harness, so this does not come with test coverage.
Fixes#3295.
Register a function to be called when AVA has completed a test run without uncaught exceptions or unhandled rejections.
Fixes#3279.
*
* Completion handlers are invoked in order of registration. Results are not awaited.
Always await the last pending state when the watch runs have completed.
Use a teardown hook to ensure the watcher is aborted and has exited before ending the test.
Ensure the item is always an object, even if it didn't come from the generator.
* 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
Somewhere between developing the watch mode and adding test coverage, a mechanism was introduced to control watch mode in its integration tests. Ironically watch mode relied on this mechanism and no longer worked in actual use.
Fixes#3270
Fixes#1718.
With worker threads, this seems to stop AVA from detecting that the thread has exited, causing a hang.
Also remove flush logic implemented in #1722. Let's hope that current Node.js versions are better at flushing IPC before exiting.
* Update dependencies
* Ignore snapshot fixture due to churn
* Remove errant log
* Update GHA actions
* Test type definition with TS 5.3
* Select latest LTS in Volta
* Remove unnecessary npx invocation
* Rebuild lockfile
* Work around legacy tap-based tests choking on our tsconfig.json
No idea why it's even resolving the config when there are no TypeScript tests to run.
* Clarify why we've posted the Ukraine war CTA and remove the third-party banner
* Remove Twitter link
It's not the best place to get updates.
* Thread isolation, not process (at least by default)
* Fix link
* Remove outdated comparison with mocha/tape/tap
Add a new `observeRunsFromConfig` experiment, which allows a test run to be observed by a function installed through an `ava.config.*` file.
The function has access to AVA's internal events, which can then be used to report to a file.
AVA's internal event structure is not currently covered by any SemVer guarantees, which is why this feature requires the experimental opt-in.
Does not currently support watch mode. Only the first run is observed.
When I first retained the AVA 5 logic, it was under the assumption AVA 6 would be released in the summer with another breaking release later in the year. It's now autumn, Node.js 16 is end of life, and for now it's just not worth having this logic around.
Depending on how well the watcher works I'm not opposed to having it as an experimental "select your watch mode" feature though.
* Update dependencies
* Rely on Node.js 18 language features
* Other small changes
* Upgrade to tap@18
* Develop and test with typescript@5.2
* Rebuild lockfile
---------
Co-authored-by: Mark Wubben <mark@novemberborn.net>
* Drop support for Node.js 16
* Change expected Node.js 18 to 18.18
* Change expected Node.js 20 to 20.8
* Add Node.js 21 to the test matrix
* Change snapshot tests to compare decompressed bitstreams
The snapshots are compressed differently in Node.js 21. The compression has been stable for many versions but that is not a guarantee, see https://github.com/nodejs/node/issues/50138 for background.
Change tests to compare the decompressed data instead.
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 commit simplifies error serialization, relying on the advanced IPC for child processes & worker threads. Unnecessary code has been removed.
Possibly breaking changes:
* Renamed and removed fields from the undocumented AssertionError class, including the raw values
* Changes to the undocumented TAP output; stack traces are a bit worse, the rest is about the same but some fields have different names or values
* `nyc` stack frames are no longer ignored; we assume you're using the native code coverage tools