Skip to content
Latchkey

Jasmine "No specs found" - Spec Glob & helpers in CI

Jasmine ran but its spec_dir/spec_files configuration matched no files, so it reports "No specs found" and exits. Usually the glob does not match your filenames or CI runs from the wrong directory.

What this error means

Jasmine finishes instantly with "No specs found" and zero tests. The exit status may even be success, silently hiding that nothing was actually verified in CI.

Jasmine output
Randomized with seed 12345
No specs found
Finished in 0.001 seconds

Common causes

spec_files glob matches nothing

Jasmine resolves spec_files relative to spec_dir. If your tests are not under that directory, or do not match the suffix (default *[sS]pec.js), none are found.

Wrong working directory in CI

Running jasmine from a directory where the configured spec_dir resolves to no files yields an empty run.

How to fix it

Point spec_dir/spec_files at your tests

jasmine.json
// spec/support/jasmine.json
{
  "spec_dir": "spec",
  "spec_files": ["**/*[sS]pec.js"],
  "helpers": ["helpers/**/*.js"]
}

Run from the right place and verify discovery

  1. Confirm CI runs Jasmine from the project root so spec_dir resolves.
  2. Match the spec_files suffix to your filenames (*.spec.js vs *Spec.js).
  3. Fail the build if zero specs run, so an empty discovery is not a silent pass.

How to prevent it

  • Commit an explicit spec_files glob instead of relying on defaults.
  • Add a guard that fails CI when zero specs execute.
  • Keep the spec suffix convention consistent across the repo.

Frequently asked questions

What causes ""No specs found""?
Jasmine resolves spec_files relative to spec_dir. If your tests are not under that directory, or do not match the suffix (default *[sS]pec.js), none are found.
How do I fix "No specs found"?
Point spec_dir/spec_files at your tests

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card