Skip to content
Latchkey
Test Runners

Jest, Vitest, Cypress, Playwright, RSpec - test failures decoded.

Fix test-runner errors in CI: Jest, Vitest, Mocha, Cypress, Playwright, Selenium, RSpec, and PHPUnit - config, timeouts, flakiness, and CI-only failures.

JS test runners

Jest, Vitest, Mocha config & failures.

"Cannot find module"Fix Jest "Cannot find module" in CI - a missing dependency, an unmapped path alias, or a case-sensitive "Cannot use import statement"Fix Jest "SyntaxError: Cannot use import statement outside a module" in CI - an ESM-only dependency left "duplicate ... naming collision"Fix Jest "jest-haste-map: Haste module naming collision" and "duplicate manual mock found" in CI - two files "New snapshot was not written"Fix Jest "New snapshot was not written: The update flag must be explicitly passed" in CI - Jest refuses to "TextEncoder is not defined"Fix Jest jsdom "ReferenceError: TextEncoder is not defined" in CI - a Web API jsdom does not implement. "SecurityError: localStorage"Fix Jest jsdom "SecurityError: localStorage is not available for opaque origins" - set a testURL/jsdom URL or setupFilesAfterEnv not loadingFix Jest "expect(...).toBeInTheDocument is not a function" or missing global hooks - a setupFilesAfterEnv transformIgnorePatterns mis-setFix Jest still failing on an ESM dependency after editing transformIgnorePatterns - a wrong "Cannot find name 'describe'"Fix ts-jest "Cannot find name 'describe'/'it'/'expect'" in CI - the Jest type definitions are not in scope. vi.mock hoisting errorFix Vitest vi.mock hoisting errors - "Cannot access X before initialization" / "There are some problems "Cannot find package happy-dom"Fix Vitest "Cannot find package happy-dom" or jsdom in CI - the DOM environment is an optional peer you "failed to access its internal state"Fix Vitest "Vitest failed to access its internal state" in CI - two copies of Vitest loaded at once, a "No test files found"Fix Vitest "No test files found, exiting with code 1" in CI - an include glob that matches nothing, the wrong "No test files found"Fix Vitest "No test files found, exiting with code 1" in CI - an include glob that matches nothing, wrong Vitest pool crashFix Vitest worker crashes and "Module did not self-register" / segfaults in CI by choosing the right pool - "ReferenceError: describe is not defined"Fix Vitest "ReferenceError: describe is not defined" / "expect is not defined" in CI - enable globals in "Cannot use import.meta"Fix "import.meta is not available" / "Cannot use import.meta outside a module" in tests - Jest CommonJS lacks

E2E & browser

Cypress, Playwright, Selenium.

Other languages

RSpec, PHPUnit, and more.

Explore other topics