Jest "Your test suite must contain at least one test"
Jest loaded a file matching your test pattern but found no test()/it() calls in it. A non-test file got matched, every test is skipped, or the suite is genuinely empty.
What this error means
Jest fails one specific file with "Your test suite must contain at least one test." The rest of the run may pass - only the empty or fully-skipped file is reported as a failure.
FAIL src/setupHelpers.test.ts
● Test suite failed to run
Your test suite must contain at least one test.Common causes
A helper file matched the test pattern
A file named *.test.ts (or under __tests__) holds only fixtures/helpers and no it(). Jest treats it as a suite and reports it empty.
All tests are skipped or filtered out
Every test uses it.skip/xit, or an it.only/--testNamePattern elsewhere filtered them all out, leaving zero runnable tests.
How to fix it
Exclude non-test files from the pattern
Rename helper files so they do not match, or narrow testMatch/testPathIgnorePatterns.
// jest.config.js
module.exports = {
testPathIgnorePatterns: ['/node_modules/', '/__tests__/helpers/'],
};Add a real test or unskip
- If the file should have tests, add at least one
it()/test(). - If everything is
it.skip/xit, unskip the tests you meant to run. - Check for a stray
it.onlyin another file that filtered this one to zero.
How to prevent it
- Name fixtures and helpers so they fall outside
testMatch. - Lint for focused/skipped tests with
eslint-plugin-jest. - Keep helper modules outside the test glob entirely.