Skip to content
Latchkey

Deno "error: No test modules found" in CI

deno test looks for files matching its test patterns (names ending in _test / .test, or test.*). When nothing matches, it reports "No test modules found" and exits nonzero, which fails the job.

What this error means

The step fails with "error: No test modules found" even though tests exist, because the working directory or include pattern did not match them.

deno
error: No test modules found

Common causes

Test files do not match the naming pattern

Deno only auto-discovers files like *_test.ts or *.test.ts; other names are not picked up without an explicit path.

The step runs in the wrong directory or excludes the tests

CI runs deno test from a folder with no tests, or a deno.json test exclude filters them out.

How to fix it

Point deno test at the right files

  1. Name tests with the recognized suffix, or pass the path explicitly.
  2. Run from the directory that contains the tests.
  3. Re-run so tests are discovered.
Terminal
deno test tests/

Configure test include in deno.json

Declare where tests live so discovery is explicit and consistent in CI.

deno.json
{
  "test": {
    "include": ["tests/"]
  }
}

How to prevent it

  • Name test files with _test.ts / .test.ts so they are discovered.
  • Configure test include in deno.json for non-standard layouts.
  • Run deno test from the correct working directory in CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →