Skip to content
Latchkey

Storybook test-runner "No tests found" in CI

The test-runner generates one test per story from the served Storybook's index. "No tests found" means it connected but the index was empty, or it looked in the wrong place, so there was nothing to run.

What this error means

The runner exits reporting "No tests found" even though Storybook builds and has stories.

test-runner
No tests found, exiting with code 1
Ran all test suites.

Common causes

Testing a stale or empty static build

The runner points at a storybook-static that was built without stories, so its index.json lists none.

A URL pointing at the wrong Storybook

The --url reaches a server that is not the Storybook with your stories, so the index is empty.

How to fix it

Test a fresh build that includes stories

  1. Rebuild Storybook so storybook-static/index.json includes your stories.
  2. Serve that build and point the runner at it.
  3. Re-run so the index yields tests.
Terminal
npm run build-storybook
npx http-server storybook-static --port 6006 --silent &
npx wait-on tcp:127.0.0.1:6006
npx test-storybook --url http://127.0.0.1:6006

Confirm story globs are not empty

If the build has no stories, fix the stories glob first (see the no story files error).

How to prevent it

  • Serve the same build you tested, freshly built with stories.
  • Verify the runner URL matches the served Storybook.
  • Fail CI if the story count is unexpectedly zero.

Related guides

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