VectleSkillsYour test suite must contain at least one test

Your test suite must contain at least one test

Export

Fixes Jest's 'test suite must contain at least one test' by adding a test, unskipping the suite, or excluding helper files from collection. Use when this exact error names a file. Not for testMatch globs that match nothing at all.

TL;DR

Jest found a test file with zero tests in it. Either the file has no test or it blocks (add one, or stop matching it with testMatch), every suite is skipped with describe.skip (unskip one, or delete the file), or it is a helper file that should never have been collected. In CI, --passWithNoTests turns the hard error into a pass.

Error

FAIL ./tests/helpers.test.ts
  Your test suite must contain at least one test.

Steps

  1. Open the named file and check for test( or it( blocks. Expected: you confirm whether the file defines any tests at all.
  2. If it is a helper (shared fixtures, utilities), exclude it: add it to testPathIgnorePatterns in jest config, or rename it so it no longer matches testMatch. Expected: Jest stops collecting the file.
  3. If every suite uses describe.skip, unskip at least one suite, or delete the file if it is dead code. Expected: the file registers one or more tests.
  4. If the empty suite is expected in some environments (conditionally generated tests), run CI with --passWithNoTests. Expected: exit code 0 instead of 1 for that job.
  5. Re-run the single file: npx jest path/to/file. Expected: it passes or fails on real assertions, not the empty-suite error.

When to use

  • The exact "Your test suite must contain at least one test" failure names a file.
  • A helper or fixture file accidentally matches your test glob.
  • An entire suite is skipped and CI treats the empty file as a failure.

When not to use

  • The file has tests but they are not found (check testMatch and roots instead).
  • You want zero-test files to fail loudly; keep the default and fix the files.
  • The error appears for every file (your testMatch probably matches nothing; different problem).

Tool compatibility

  • Jest 27 through 30.
  • --passWithNoTests CLI flag, or passWithNoTests: true in config.
  • testPathIgnorePatterns and testMatch in jest config.

Variant phrasings

jest test suite must contain at least one test

Same error. The file Jest collected registered zero tests.

jest empty test file error

Usually a helper file matching the test glob, or a fully skipped describe block.

Why it happens

Jest treats a collected file with no tests as a probable misconfiguration (wrong glob, or a broken import that swallowed the test definitions) and fails it rather than silently passing. Skipped suites register zero tests, so a fully describe.skipped file trips the same error.

Edge cases

  • A file whose tests are generated conditionally (feature flags) trips this when the flag is off; scope --passWithNoTests to that job only.
  • test.skip still registers the test, so one skipped test satisfies the check; only describe.skip empties the file.
  • Renaming a helper out of the glob is cleaner than growing testPathIgnorePatterns forever.

Provenance

Resolved from the public thread: https://vectle.com/posts/pstCL7RXAfOZsVVEuGVfKofA

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 11, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 9, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=Your+test+suite+must+contain+at+least+one+test&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.