Registry / testing / cucumber-pretty

cucumber-pretty

JSON →
library6.0.1jsnpmunverified

This package provides a custom pretty formatter for Cucumber.js versions 3 to 6, using the event protocol. It is deprecated in favor of @cucumber/pretty-formatter for Cucumber.js v7+. The last stable version is 6.0.1, which supports Cucumber.js v6. It requires explicit path usage in the CLI and has no breaking changes within its supported range. The key differentiator is its compatibility with older Cucumber.js versions while offering a visually enhanced output compared to the built-in formatters.

npm install cucumber-pretty
INSTALL
IMPORT
SIG · CUCUMBER-PRETTY
C
cucumber-pretty
testingjavascriptv6.0.1
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.

default formatter
✓ cucumber-js -f node_modules/cucumber-pretty
✗ cucumber-js -f pretty
For Cucumber.js v6, you must specify the full path to the formatter module. The -f pretty alias is only for built-in formatters.
programmatic usage
✓ const prettyFormatter = require('cucumber-pretty');
✗ import prettyFormatter from 'cucumber-pretty';
This package uses CommonJS. ESM import is not supported and will fail.
formatter in configuration
✓ "format": ["node_modules/cucumber-pretty"]
✗ "format": ["cucumber-pretty"]
The formatter must be referenced by its file path, not just by package name.

This example shows how to install and use cucumber-pretty with Cucumber.js v6 from the command line, including the required formatter path.

// Install the formatter and Cucumber.js v6 // npm install cucumber@6 cucumber-pretty@6 // Create a simple feature file: features/example.feature // Feature: Example // Scenario: Passing // Given a step // Run with the formatter: // npx cucumber-js features/example.feature -f node_modules/cucumber-pretty // Output will be a colorful, indented representation of the test run.
Debug
Known issues
deprecatedcucumber-pretty is deprecated for Cucumber.js v7+. Use @cucumber/pretty-formatter instead.
fix
npm install @cucumber/pretty-formatter and use -f @cucumber/pretty-formatter
affects: >=7.0
breakingRequires exact peer dependency: cucumber >=6.0.0 <7.0.0. Will not work with Cucumber.js v7 or v5.
fix
Downgrade or upgrade cucumber to v6, or use the appropriate formatter for your version (cucumber-pretty@1.5 for v3-v5, @cucumber/pretty-formatter for v7+).
affects: >=6.0.0 <7.0.0
gotchaThe CLI argument must be the full path 'node_modules/cucumber-pretty'. Using '-f pretty' without installation causes a 'formatter not found' error.
fix
Use -f node_modules/cucumber-pretty or configure in cucumber.js file with format: ['node_modules/cucumber-pretty'].
affects: >=6.0
Errors
Common errors & fixes
Formatter 'pretty' not found
Using -f pretty with cucumber-pretty installed, but for Cucumber.js v6 the formatter must be referenced by path.
fix
Use -f node_modules/cucumber-pretty instead of -f pretty.
Cannot find module 'cucumber-pretty'
Package not installed or wrong version of Cucumber.js.
fix
Run 'npm install cucumber-pretty@6' with Cucumber.js v6 installed, or for v3-v5 use 'npm install cucumber-pretty@1.5'.
Error: Unsupported Cucumber version. cucumber-pretty requires Cucumber >=6.0.0 <7.0.0
Using Cucumber.js v7 or v5 with cucumber-pretty v6.
fix
Either downgrade Cucumber.js to v6, or use the appropriate formatter: @cucumber/pretty-formatter for v7, cucumber-pretty@1.5 for v3-v5.
Upgrade
Version history
6.0.1latest on npm
Audit
Dependencies
cucumberoptionalPeer dependency: requires cucumber >=6.0.0 <7.0.0
Agent activity
11 hits · last 30 days
node
10
Resources
cucumber-pretty — npm install cucumber-pretty · libregistry