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.
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
* Track worker errors. They're not native due to https://github.com/nodejs/node/issues/48716, but we want to treat them as such anyway.
* Only treat native errors as errors
* Remove is-error dependency
* Document edge case where `error instanceof Error` can be true, yet AVA does not recognize `error` as an error
See also https://github.com/avajs/ava/pull/2911 for an earlier attempt.
Rely on recursive fs.watch(), rather than Chokidar. On Linux this is supported from Node.js 20 onwards. It won't work for network shares and Docker volume mounts which would require polling, we'll find out if that's a problem or not. (For now, the previous implementation is still available.)
Use @vercel/nft to perform static dependency analysis, supporting ESM and CJS imports for JavaScript & TypeScript source files. This is a huge improvement over the previous runtime tracking of CJS imports, which did not support ESM.
Rewrite the change handling logic to be easier to follow (though it's still pretty complicated).
Improve integration with `@ava/typescript`. The watcher can now detect a change to a TypeScript source file, then wait for the corresponding build output to change before re-running tests.
Restrict @ava/typescript to the ava-3.2 protocol, since the legacy code is not compatible with the ava-6 protocol.
Remove brittle tests for the legacy code.
* Test against typescript@5.0
* Default to Node.js 20
* Upgrade XO
* Add reporter logs for Node.js 20
* Update dev dependencies
* Reduce timeouts in reporter tests
This may cause CI failures especially on Windows, but we do waste a lot of time with these tests.
* Inline slash dependency
We need it available in CJS but the package is now ESM only. It's more bothersome to remember to not upgrade the dependency than to inline it.
* Update dependencies
* Rebuild lockfile
* Use latest Codecov action
* Upgrade XO and reformat
* Update dev dependencies
* Test with TypeScript 4.9
* Update dependencies
* Pin latest node@18 for Volta
* Use npm@9
* Rebuild lockfile
* Select Node.js version from Volta pin in most CI jobs
* Only pin npm when testing for lockfile churn; ensure npm@8 for Node.js 14
* Upgrade to TypeScript 4.8. Keep testing with 4.7 to ensure backwards compatibility.
* Update dev dependencies
* Update dependencies
* Tweak type definitions used in exports map for TS 4.8 compatibility. Duplicate and export shared types where appropriate, but don't export from the other export file since it seems to confuse things.
Add shims for TypeScript's 'node' module resolution algorithm. The exports map is only used with the `node16` algorithm.
Write types in CommonJS, so they can be exported from ESM files. The other way around is prone to, at the very least, confusing warnings.
* Only test against TypeScript 4.7
* Move type definitions to entrypoints/
Only TS 4.7 will resolve them now, but it's cleaner.
* Use @sindresorhus/tsconfig
* Fix test TypeScript files, make compilable and lintable
* Use tsc directly, instead of tsd
* Add *.cts versions of type tests
* Reorganize type tests
* Use tsc directly, avoid npx, print actual version
Somehow `npx tsc` was pointing at an older version. Possibly the binstubs are corrupted in CI… somehow.
* Remove Node.js 17 support
* Add Node.js 18 support
* Use latest everything for CI tasks
* Configure Volta for managing development versions
* Update dependencies
* Update dev dependencies
* Update dependencies
* Remove concurrency limit for internal tests
* Test with TypeScript 4.6
* Update XO and fix formatting
* Fix reference to chalk's color level
* Upgrade XO and reformat
* Update dev dependencies
* Update production dependencies
* Rebuild lockfile
* CI: Continue when 'npm ls' errors in TypeScript compatibility job