SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
Testing New Added 10 September 2026

Jest: Your test suite must contain at least one test.

A file matched the test pattern but declared no test. Helper files living beside the tests are the usual reason, because the default pattern picks up everything inside a __tests__ directory, not only files named .test.js. A file where every test is skipped or filtered out fails the same way.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# What the pattern is actually matching
npx jest --listTests

// Keep helpers out of the matched set
// jest.config.js
module.exports = {
  testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"],
  testPathIgnorePatterns: ["/node_modules/", "/__tests__/helpers/"]
};

// A suite whose tests are all skipped counts as empty
describe.skip("orders", () => { ... });   // whole file fails
it.todo("handles refunds");               // this one is allowed

// A -t filter that matches nothing does it too
// npx jest -t "no such name"

// Conditionally generated tests: assert the list is not empty
if (cases.length === 0) throw new Error("no fixtures found");
test.each(cases)("case %s", ...);

How to diagnose Testing errors

Test errors divide into infrastructure problems (the framework cannot find or load your tests, fixtures or modules) and flakiness, which is the more expensive category. End-to-end timeouts are almost always a race between the test and the application, and the durable fix is to wait for a condition (an element, a network response, a state change) rather than for a duration.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Run a single failing test in isolation. If it passes alone but fails in the suite, you have shared state or test ordering dependence.
  2. For Cypress and Playwright timeouts, use the trace viewer or video to see what the page actually showed. The element usually exists but is covered, detached, or not yet interactive.
  3. Replace fixed waits with condition-based waits. waitForSelector and auto-retrying assertions eliminate an entire class of flakiness.
  4. For collection and module-resolution errors, check the framework's rootDir/testPaths configuration and the presence of __init__.py or conftest.py where the framework expects it.
  5. Review snapshot diffs rather than updating them reflexively. A changed snapshot is sometimes a real regression.

Tools worth reaching for

  • playwright show-trace
  • pytest -x -vv --tb=long
  • jest --runInBand
  • cypress open
  • test retry analytics

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

jestjs.io

Related Testing errors

See all 18 Testing errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.