Registry / testing / cypress-fail-fast

cypress-fail-fast

JSON →
library8.1.0jsnpmunverified

Cypress plugin that skips remaining tests after the first failure. Current stable version is 8.1.0, released with monthly cadence. Supports configurable strategies (skip current spec vs entire run), per-test hooks, and parallel run coordination. Ships TypeScript types and requires Cypress >=15.10.0 and Node >=20.0.0. Differentiators: fine-grained per-test/suite control, hook-based extensibility, explicit parallel run support via external signals.

npm install cypress-fail-fast
INSTALL
IMPORT
SIG · CYPRESS-FAIL-FAST
C
cypress-fail-fast
testingjavascriptv8.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
import cypressFailFast from 'cypress-fail-fast/plugin'
import cypressFailFast from 'cypress-fail-fast'
The plugin function is exported from a subpath 'cypress-fail-fast/plugin', not the main entry point.
side-effect import
import 'cypress-fail-fast'
const failFast = require('cypress-fail-fast')
No named export from main package; just import the module for side effects in support file.
types
import type { CypressFailFastConfig } from 'cypress-fail-fast'
import { CypressFailFastConfig } from 'cypress-fail-fast'
Type exports are only available as type imports if using TypeScript; they are not runtime values.

Registers the plugin in Cypress config and enables fail-fast in support file.

// cypress.config.ts import { defineConfig } from 'cypress'; import cypressFailFast from 'cypress-fail-fast/plugin'; export default defineConfig({ e2e: { setupNodeEvents(on, config) { cypressFailFast(on, config); return config; }, }, }); // cypress/support/e2e.ts import 'cypress-fail-fast'; // Now, after a test fails (after last retry), remaining tests are skipped. // Default strategy is 'run' (skip all remaining tests in the run). // To override per test: it('my test', { failFast: { enabled: false } }, () => { ... })
Debug
Known issues
breakingVersion 8.0.0 dropped support for Node <20 and Cypress <15.10.0. Also changed 'fa' option to 'failFastStrategy'.
fix
Upgrade Node to >=20 and Cypress to >=15.10.0. Rename 'fa' to 'failFastStrategy'.
affects: >=8.0.0
breakingVersion 7.0.0 renamed plugin import from 'cypress-fail-fast/src/plugin' to 'cypress-fail-fast/plugin'.
fix
Update import path to 'cypress-fail-fast/plugin'.
affects: >=7.0.0 <8.0.0
deprecatedThe 'fa' option is deprecated since v7.0.0 in favor of 'failFastStrategy'. It will be removed in next major.
fix
Replace 'fa' with 'failFastStrategy' in plugin options.
affects: >=7.0.0 <8.0.0
gotchaSkipped tests appear as 'pending' in Cypress UI, not as 'skipped'. This is by design due to Mocha's this.skip() behavior.
fix
No fix needed; treat pending as skipped.
affects: all
gotchaThe plugin must be registered in setupNodeEvents AND imported in the support file. Omitting either will cause fail-fast not to work.
fix
Ensure both steps are followed: plugin registration in config and import in support file.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'cypress-fail-fast/plugin'
Import path is wrong or package not installed.
fix
Install the package: npm install --save-dev cypress-fail-fast. Use correct import: import cypressFailFast from 'cypress-fail-fast/plugin'.
CypressError: cypress-fail-fast plugin failed to load: The 'failFastStrategy' option must be either 'spec' or 'run'.
Invalid value provided for 'failFastStrategy'.
fix
Set failFastStrategy to 'spec' or 'run' (e.g., { expose: { failFastStrategy: 'spec' } }).
TypeError: cypressFailFast is not a function
Incorrect import; importing default from main package instead of subpath.
fix
Use import cypressFailFast from 'cypress-fail-fast/plugin' (with /plugin).
Mocha: 'this.skip()' is not available in before hooks
The plugin uses beforeEach, but if you have custom before hooks that call this.skip(), it may conflict.
fix
Do not use this.skip() in before hooks; rely on plugin's beforeEach to skip tests.
Upgrade
Version history
8.1.0latest on npm
Audit
Dependencies
cypressrequiredpeer dependency, Cypress >=15.10.0 required
Agent activity
9 hits · last 30 days
node
8
Resources
cypress-fail-fast — npm install cypress-fail-fast · libregistry