jest-compact-reporter
TypeScript icon, indicating that this package has built-in type declarations

1.2.9 • Public • Published

Jest Compact Reporter

Fork of Sunfit's jest-summary-reporter. Rewritten in TypeScript with a few additional options.

Motivation

The default Jest reporter output is sometimes too fancy, especially in environments which doesn't support things such as colours etc. This can make the output difficult to read.

This custom reporter will print a more compact form of the information showing only the failed tests by default.

Additional options are available to customise the output. See options.

Examples

Default

default-output

No colours

default-output

Show passing tests

With single test

default-output

With multiple tests

default-output

No diffs

default-output

Mixed tests

default-output

Installation

With NPM

npm i -D jest-compact-reporter

With Yarn

yarn add jest-compact-reporter -D

Usage

CLI

jest <...args> --reporters jest-compact-reporter

Jest Config

No options

// jest.config.js or jest.config.ts
{
  "reporters": ["jest-compact-reporter"]
}

With options

// jest.config.js or jest.config.ts
{
  "reporters": [
      ["jest-compact-reporter", { diffs: true, colours: true, showPassingTests: false }]
    ]
}

Options

diffs

Defaults to true. If enabled prints Jest's default error explanations for each failing test.

colours

Defaults to true. If enabled adds colours to the output for improved readability. Disable when an environment doesn't support colours.

showPassingTests

Defaults to false. If enabled shows test names of passing tests as well rather than just the suite.

Contributing

Requirements

  • Node 12+
  • Jest 20+
  • NPM 6 or Yarn

Developing

  1. Run npm install or yarn install
  2. Run npm build-and-test to test changes to the reporter. Note the default jest.config.ts has already been setup to use the development reporter.

License

Unlicense Licence

See LICENCE.md

Package Sidebar

Install

npm i jest-compact-reporter

Weekly Downloads

1,568

Version

1.2.9

License

Unlicense

Unpacked Size

20.7 kB

Total Files

25

Last publish

Collaborators

  • axises