AVA now requires Node.js versions 18.18, 20.8 or 21. Versions 14 and 16 are no longer supported. #3251#3216
When tests finish, worker threads or child processes are no longer exited through proces.exit(). If your test file does not exit on its own, the test run will time out. #3260
Watch mode can no longer be started via the ava.config.* or package.json configuration.
The ignoredByWatcher configuration has moved to the watchMode object, under the ignoreChanges key.
Watch mode now uses the built-in fs.watch() in recursive mode. This is supported on Linux in Node.js 20 or newer, and MacOS and Windows in Node.js 18 as well. There are caveats to keep in mind.
Failed assertions now throw, meaning that any subsequent code is not executed. This also impacts the type definitions. #3246
Changes to modules loaded through the require configuration #3184:
If such modules export a default function, this function is now invoked.
Local files are loaded through @ava/typescript if necessary.
Improvements
Rewritten watcher
The watcher has been rewritten. It’s now built on fs.watch() in recursive mode.
@vercel/nft is used 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.
Integration with @ava/typescript has been improved. 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.
The ignoredByWatcher configuration has moved to the watchMode object, under the ignoreChanges key.
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 t.throws() and t.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.
t.throws() and t.throwsAsync() can now expect any error
By default, the thrown error (or rejection reason) must be a native error. You can change the assertion to expect any kind of error by setting any: true in the expectation object:
Fix TypeScript-specific class transform edge case (#3559)
The previous release introduced an optimization that avoided transforming super() in the class constructor for TypeScript code compiled with useDefineForClassFields set to false if all class instance fields have no initializers. The rationale was that in this case, all class instance fields are omitted in the output so no changes to the constructor are needed. However, if all of this is the case and there are #private instance fields with initializers, those private instance field initializers were still being moved into the constructor. This was problematic because they were being inserted before the call to super() (since super() is now no longer transformed in that case). This release introduces an additional optimization that avoids moving the private instance field initializers into the constructor in this edge case, which generates smaller code, matches the TypeScript compiler's output more closely, and avoids this bug:
// Original code
class Foo extends Bar {
#private = 1;
public: any;
constructor() {
super();
}
}
// Old output (with esbuild v0.19.9)
class Foo extends Bar {
constructor() {
super();
this.#private = 1;
}
#private;
}
// Old output (with esbuild v0.19.10)
class Foo extends Bar {
constructor() {
this.#private = 1;
super();
}
#private;
}
// New output
class Foo extends Bar {
#private = 1;
constructor() {
super();
}
}
Minifier: allow reording a primitive past a side-effect (#3568)
The minifier previously allowed reordering a side-effect past a primitive, but didn't handle the case of reordering a primitive past a side-effect. This additional case is now handled:
Fix TypeScript-specific class transform edge case (#3559)
The previous release introduced an optimization that avoided transforming super() in the class constructor for TypeScript code compiled with useDefineForClassFields set to false if all class instance fields have no initializers. The rationale was that in this case, all class instance fields are omitted in the output so no changes to the constructor are needed. However, if all of this is the case and there are #private instance fields with initializers, those private instance field initializers were still being moved into the constructor. This was problematic because they were being inserted before the call to super() (since super() is now no longer transformed in that case). This release introduces an additional optimization that avoids moving the private instance field initializers into the constructor in this edge case, which generates smaller code, matches the TypeScript compiler's output more closely, and avoids this bug:
// Original code
class Foo extends Bar {
#private = 1;
public: any;
constructor() {
super();
}
}
// Old output (with esbuild v0.19.9)
class Foo extends Bar {
constructor() {
super();
this.#private = 1;
}
#private;
}
// Old output (with esbuild v0.19.10)
class Foo extends Bar {
constructor() {
this.#private = 1;
super();
}
#private;
}
// New output
class Foo extends Bar {
#private = 1;
constructor() {
super();
}
}
Minifier: allow reording a primitive past a side-effect (#3568)
The minifier previously allowed reordering a side-effect past a primitive, but didn't handle the case of reordering a primitive past a side-effect. This additional case is now handled:
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the development-dependencies group with 4 updates: ava, esbuild, open-cli and undici.
Updates
ava
from 5.3.1 to 6.0.1Release notes
Sourced from ava's releases.
... (truncated)
Commits
5975b60
6.0.132f282f
Ensure watch mode works outside of its integration testscf7a288
6.0.0af5684d
Don't force-exit after tests have completed88e4333
Update dependencies & other minor tweakscac1d1f
Tweak README0492d32
Fix external assertions tests for Node.js 21adbfcde
Experimentally expose internal events for custom reporters6790d50
Update memoize dependencye07179b
Remove ability to select AVA 5 watcherUpdates
esbuild
from 0.19.8 to 0.19.11Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
6ee8225
publish 0.19.11 to npmf8ae3af
fix #3561: treeshaking of knownSymbol
instances0811058
switch define data to flagsf5f8ff8
fix #3568: can reorder primitive past side-effect914f608
fix #3558: put thestop()
api call back2aa166b
fix #3559: fix recent class transform regression55e1127
publish 0.19.10 to npmd968af2
fix #3511:@__NO_SIDE_EFFECTS__
with templates00c4ebe
fix #3546: don't transformrequire
glob importse1b7050
fix #3319: missing symbol usage in glob transformUpdates
open-cli
from 7.2.0 to 8.0.0Release notes
Sourced from open-cli's releases.
Commits
9550e18
8.0.0bb32fe9
Require Node.js 18Updates
undici
from 5.28.2 to 6.2.1Release notes
Sourced from undici's releases.
... (truncated)
Commits
f51f917
Bumped v6.2.136e8131
Remove timers in agent.js (#2536)5f4d435
chore: reduce dependencies (#2533)c5c6648
perf: use tree (#2528)0c4c450
Bumped v6.2.059c2f38
Remove FinalizationRegistry from Agent (#2530)250b89a
Bumped v6.1.038f2226
feat: expose headerNameToString (#2525)974a85e
Call fg.unregister() after a dispatcher is done, adds UNDICI_NO_FG to… (#2527)871baa7
feat: Add resource timing entries for connection, request and response (#2481)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show