Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@cucumber/pretty-formatter

cucumber1.9mMIT2.0.1TypeScript support: included


pretty-formatter

Writes a rich report of the scenario and example execution as it happens

readme


pretty-formatter

Writes a rich report of the scenario and example execution as it happens

Latest version on npm Build status

Example output of the pretty formatting, showing the different colors used

Usage

For usage in @cucumber/cucumber, see https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md#pretty

Options

  • featuresAndRules - whether to include headings for Features and Rules (defaults to true)
  • theme - control over the styling of various elements (see below)

Themes

Here's the schema for a theme:

interface Theme {
    attachment?: Style
    dataTable?: {
        all?: Style
        border?: Style
        content?: Style
    }
    docString?: {
        all?: Style
        content?: Style
        delimiter?: Style
        mediaType?: Style
    }
    feature?: {
        all?: Style
        keyword?: Style
        name?: Style
    }
    location?: Style
    rule?: {
        all?: Style
        keyword?: Style
        name?: Style
    }
    scenario?: {
        all?: Style
        keyword?: Style
        name?: Style
    }
    status?: {
        all?: Partial<Record<TestStepResultStatus, Style>>
        icon?: Partial<Record<TestStepResultStatus, string>>
    }
    step?: {
        argument?: Style
        keyword?: Style
        text?: Style
    }
    tag?: Style
}

enum TestStepResultStatus {
    UNKNOWN = "UNKNOWN",
    PASSED = "PASSED",
    SKIPPED = "SKIPPED",
    PENDING = "PENDING",
    UNDEFINED = "UNDEFINED",
    AMBIGUOUS = "AMBIGUOUS",
    FAILED = "FAILED"
}

Style is any Node.js supported modifier or an array of them.

See the default theme for a good example. It's exported as CUCUMBER_THEME, so you can clone and extend it if you'd like.

changelog

Changelog

All notable changes to this project will be documented in this file.

The formatter is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

2.0.1 - 2025-07-19

2.0.0 - 2025-07-18

Changed

0.3.0 - 2025-07-10

Added

  • Add status icons and plain text theme (#3)

Changed

  • Update dependency io.cucumber:query to v13.5.0

0.2.0 - 2025-07-07

Changed

  • Update dependency io.cucumber:messages to v28

0.1.0 - 2025-07-07

Added

  • Java implementation (#1 M.P. Korstanje)