Skip to content

Upgrading ava 7 to 8

Breaking7.0.0 → 8.5.0Breaking5Platform2Deprecated1New7Changed11Fixed10Other6

BreakingUpgrade verdict

5 breaking changes and 2 platform requirement changes.

  • If your snapshot files include the new code blocks, older AVA versions cannot read them. Other snapshots still work as before.
  • If your project uses require() to load AVA, you now need to pull the default export out of the required module.
  • AVA no longer picks up .cjs test files by default. If you have them, list the extension explicitly.
  • AVA now loads test files as ES modules, so transpilers must hook into Node's module loading, and the object form of the extensions setting no longer works.
Top 5 of 8 that need code or config changes

Node.js requirement changed in 8.0.1: ^20.19 || ^22.20 || ^24.12 || >=25 → ^22.20 || ^24.12 || >=26.

Breaking5
Snapshots containing code blocks can only be read with AVA 8.1 or newer; snapshots without code blocks remain backwards compatible.
AVA is now fully ESM internally, so CommonJS projects must change how they import it.
Default test file extensions are now js and mjs; add cjs to extensions to run .cjs test files.
extensions
Test files and require-config files load via import(); use customization hooks for transpilation and the object form of extensions is removed.
extensionsrequire
Users of @ava/typescript must upgrade that package to v7.
@ava/typescript
Platform2
Adds official support for Node.js 26.
Removes support for Node.js 25 per policy.
Deprecated1
Deprecates the filterNodeArgumentsForWorkerThreads option, to be removed in the next major release.
filterNodeArgumentsForWorkerThreadsnodeArgumentsprocess.execArgvexplicitlyForwardNodeArguments

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • changed: type SnapshotAssertion = { (expected: any, message?: string): true; skip(expected: any, message?: string): void } → type SnapshotAssertion = { (expected: any, message?: string): true; (expected: string, options: { formatAsCodeBlock: true | string }, message?: string): true; skip(expected: any, messa…
  • added: type HostMessage = { readonly type: 'configure'; readonly id: number; readonly context: Plugin.ConfigureContext } | { readonly type: 'activate' } | { readonly type: 'reject'; rea…
  • added: type PluginMessage = { readonly type: 'negotiate'; readonly supported: readonly Plugin.ProtocolIdentifier[]; readonly version: string; readonly capabilities: readonly Plugin.Capabi…
  • added: namespace Plugin
  • added: type Plugin.Capability = 'reporter'
  • added: type Plugin.ConfigureContext<Options = unknown> = ProtocolInfo & { readonly options: Options | undefined; readonly flags: Readonly<Record<string, unknown>>; readonly mode: { readonly watch: boolean; readonly d…
  • added: type Plugin.ConfigureResult<Capabilities extends Capability = Capability> = { readonly active: boolean; readonly diagnostics?: readonly Diagnostic[] } & ('reporter' extends Capabilities ? { readonly claims?: ReadonlyArray<'stdout'> } :…
  • added: type Plugin.Diagnostic = { readonly level: 'error' | 'warning'; readonly message: string }
  • added: type Plugin.Event = { readonly type: 'selected-test'; readonly testFile: string; readonly title: string; readonly knownFailing: boolean; readonly skip: boolean; readonly todo: boo…
  • added: type Plugin.Factory = (options: FactoryOptions) => void | Promise<void>
  • added: type Plugin.FactoryOptions = { negotiateProtocol<Options = unknown, Capabilities extends Capability = Capability>(supported: readonly [ProtocolIdentifier], plugin: Plugin<Options, Capabili…
  • added: type Plugin.FlagDefinition = { readonly type: 'boolean' | 'string' | 'number'; readonly description: string }
  • added: type Plugin.MessageBase = { readonly seq: number; readonly sync?: true }
  • added: type Plugin.PendingTests = ReadonlyMap<string, ReadonlySet<string>>
  • added: type Plugin.Plugin<Options = unknown, Capabilities extends Capability = Capability> = { readonly version: string; readonly capabilities: readonly Capabilities[]; readonly namespace: string; readonly flags?: Readonly<Record<string, FlagDefinition…
  • added: type Plugin.Protocol<Capabilities extends Capability = Capability> = ProtocolInfo & ('reporter' extends Capabilities ? ReporterProtocol : unknown)
  • added: type Plugin.ProtocolIdentifier = 'experimental'
  • added: type Plugin.ProtocolInfo = { readonly ava: { readonly version: string }; readonly identifier: ProtocolIdentifier; readonly projectDir: string; readonly terminal: { readonly stdout: { rea…
  • added: type Plugin.ReporterProtocol = { observe(handler: (messages: AsyncIterableIterator<RunMessage>) => Promise<void>): Promise<void> }
  • added: type Plugin.RunMessage = MessageBase & ({ readonly type: 'run-start'; readonly runId: number; readonly plan: RunPlan } | { readonly type: 'event'; readonly runId: number; readonly even…
  • added: type Plugin.RunPlan = { readonly titlePrefixes: ReadonlyMap<string, readonly string[]> }
  • added: type Plugin.RunTotals = { readonly files: number; readonly failedTests: number; readonly remainingTests: number; readonly passedTests: number; readonly passedKnownFailingTests: number…
  • added: type SerializedError = AggregateSerializedError | NativeSerializedError | AvaSerializedError
  • changed: type Meta = { file: string; snapshotDirectory: string } → type Meta = { file: string; snapshotDirectory: string; debugMode: boolean }
  • added: type RunIfFn<Chain> = (shouldRun: boolean) => Chain
  • added: type SkipIfFn<Chain> = (shouldSkip: boolean) => Chain