Skip to content
Latchkey

AVA "Couldn’t find any files to test" in CI

AVA scanned for test files using its files patterns and found none, so it exits with an error. Your filenames do not match AVA’s expected patterns, or CI runs where no tests live.

What this error means

AVA aborts with "Couldn’t find any files to test." Locally you may run a file by path and it passes, masking that the default/files glob matches nothing in CI.

AVA output
✖ Couldn't find any files to test

  See https://github.com/avajs/ava for configuring AVA's "files".

Common causes

Filenames do not match AVA patterns

AVA picks up test.js, *.test.js, and files under test//tests/ by default. Files named *.spec.ts or in another folder need an explicit files glob.

Wrong working directory or missing TS setup

Running from the wrong directory, or testing TypeScript without the @ava/typescript config, leaves AVA with nothing to match.

How to fix it

Configure a files glob that matches your tests

package.json
// package.json
"ava": {
  "files": ["src/**/*.spec.ts"],
  "extensions": { "ts": "module" },
  "nodeArguments": ["--import=tsx"]
}

Run from the project root

  1. Confirm CI invokes AVA from where the files glob resolves.
  2. Match the glob to your naming (*.test.ts vs *.spec.ts).
  3. For TypeScript, configure @ava/typescript or a loader so AVA can run .ts.

How to prevent it

  • Set an explicit files glob in the AVA config.
  • Keep filenames consistent with the configured pattern.
  • Configure TS support so .ts tests are discoverable.

Frequently asked questions

What causes ""Couldn’t find any files to test""?
AVA picks up test.js, *.test.js, and files under test//tests/ by default. Files named *.spec.ts or in another folder need an explicit files glob.
How do I fix "Couldn’t find any files to test"?
Configure a files glob that matches your tests

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card