Registry / testing / eslint-plugin-codeceptjs

eslint-plugin-codeceptjs

JSON →
library1.3.0jsnpmunverified

An ESLint plugin providing lint rules for CodeceptJS test files. Version 1.3.0 is the latest stable release, with a low release cadence (latest in 2020). It includes rules to prevent common testing anti-patterns: no-exclusive-tests (focusing tests), no-disabled-tests (skipping), no-actor-in-scenario (forcing page objects), and no-pause-in-scenario (removing debug pauses). Unlike generic ESLint rules, it understands CodeceptJS globals (I, Scenario, Data) and provides a recommended config for easy setup. It is fixable for three of its four rules, automatically removing `.only`, `.skip`, and `pause()` calls.

npm install eslint-plugin-codeceptjs
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-CODE
E
eslint-plugin-codeceptjs
testingjavascriptv1.3.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

configs.recommended
extends: ['plugin:codeceptjs/recommended']
extends: ['codeceptjs/recommended']
The recommended config is accessed via 'plugin:codeceptjs/recommended' in eslintrc.
rules
rules: { 'codeceptjs/no-exclusive-tests': 'error' }
rules: { 'no-exclusive-tests': 'error' }
Rules must be prefixed with 'codeceptjs/' when not using the recommended config.
env
env: { 'codeceptjs/codeceptjs': true }
env: { 'codeceptjs': true }
The environment is nested under the plugin name: 'codeceptjs/codeceptjs'.

Setup with full plugin config and example test file that triggers no-exclusive-tests, no-skipped-tests, and no-pause-in-scenario rules.

// Install dependencies npm install eslint eslint-plugin-codeceptjs --save-dev // .eslintrc.json { "plugins": ["codeceptjs"], "env": { "codeceptjs/codeceptjs": true }, "rules": { "codeceptjs/no-exclusive-tests": "error", "codeceptjs/no-skipped-tests": "error", "codeceptjs/no-pause-in-scenario": "warn" } } // Example test file that will trigger errors Feature('Sample'); Scenario.only('focused test', ({ I }) => { I.amOnPage('/'); pause(); // warns }); xScenario('skipped test', ({ I }) => { I.see('Hello'); }); // Run: npx eslint test.js
Debug
Known issues
gotchaThe 'no-disabled-tests' rule was renamed to 'no-skipped-tests' in version 1.0.0. Using the old name will be silently ignored.
fix
Replace 'no-disabled-tests' with 'no-skipped-tests' in your ESLint config.
affects: <1.0.0
gotchaThe environment must be specified as 'codeceptjs/codeceptjs', not just 'codeceptjs'. Omitting the namespace fails to register globals.
fix
Set env to { 'codeceptjs/codeceptjs': true } in your ESLint config.
affects: >=0.1.0
deprecatedThe 'no-pause-in-scenario' rule is fixable but its auto-fix removes pause() calls entirely, which may break tests if pause is used for debugging during development.
fix
Use fix: false on the rule or manually review removals.
affects: >=1.2.0
gotchaWhen using the recommended config, all fixable rules default to 'error'. This may be too strict for development; adjust severity as needed.
fix
Override rule severity in your config, e.g., 'codeceptjs/no-pause-in-scenario': 'warn'.
affects: >=1.1.0
breakingVersion 1.0.0 removed the old 'no-disabled-tests' rule and replaced it with 'no-skipped-tests'. Configs using the old name stop working silently.
fix
Update to 'no-skipped-tests' in your ESLint config.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'eslint-plugin-codeceptjs'
ESLint cannot locate the plugin because it's not installed or not in node_modules.
fix
Run 'npm install eslint-plugin-codeceptjs --save-dev' (or global flag if ESLint is global).
ESLint configuration error: Unknown environment 'codeceptjs'
Environment was specified as 'codeceptjs' instead of 'codeceptjs/codeceptjs'.
fix
Change env to { 'codeceptjs/codeceptjs': true }.
ESLint configuration error: Cannot read property 'recommended' of undefined
Using 'extends: 'codeceptjs/recommended' without the 'plugin:' prefix.
fix
Use 'extends: ['plugin:codeceptjs/recommended']'.
Definition for rule 'no-exclusive-tests' was not found
Rule name not prefixed with plugin namespace when not using recommended config.
fix
Prefix rule with 'codeceptjs/', e.g., 'codeceptjs/no-exclusive-tests'.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency required to load and run the plugin rules.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-codeceptjs — npm install eslint-plugin-codeceptjs · libregistry