2.1.0 • Published 7 months ago

jest-wip-reporter v2.1.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
7 months ago

jest-wip-reporter

npm version Downloads

An opinionated Jest reporter that treats all incomplete tests as WIP.

Philosophy

This reporter considers every test to be in one of three states: passing, failing, or WIP (work in progress). WIP tests represent work that is still to be finished; they won't fail your build, but the reporter will call them out and remind you loudly that your work isn't done yet.

In Jest terms, this reporter marks a test as WIP if it:

  • is marked as .todo, .failing or .skip, or
  • is skipped due to some other describe or it being marked with .only, or
  • contains no assertions.

Note that a .failing test that Jest would report as "passing" (because the test run failed) will be marked as WIP by this reporter, because the work related to it is not yet finished.

Output

image

The report generated comprises four parts:

  1. A progress report in which the outcome of each test is represented by a single character:

    • Passing: a green '.'
    • WIP: an amber '?'
    • Failing: a red 'x'
  2. A summary of WIP tests.

  3. Details of any failures.

  4. A summary of the test run.

Configuring the progress report

By default the reporter emits a single character when each test runs:

  • Passing: a green '.'
  • WIP: an amber '?'
  • Failing: a red 'x'

In this default view, the output contains a single character for each test, but describe blocks and test names are not represented.

If you need to see more context, the progress report can be configured to emit a tree of nested describe and test names by setting the environment variable $JWR_PROGRESS to tree (the default value is dots).

In the tree report, each describe is coloured to match the "worst" outcome of the tests it contains. For example, a describe block containing a WIP test and a failing test would be rendered as failing, because a failing test is "worse" than a WIP test.

Configuring the WIP report

If you have any WIP tests, by default this reporter will list them as a tree of nested describe and test titles. To replace this with a flat list of fully-qualified test names set the environment variable $JWR_WIP_REPORT to list (the default value is tree).

Installation

Install as a development dependency:

npm install --save-dev jest-simple-dot-reporter

or

yarn add --dev jest-simple-dot-reporter

Then configure Jest to use this reporter.

For example, create a jest.config.js file containing:

module.exports = {
  "verbose": false,
  "reporters": [
    "jest-wip-reporter",
  ]
};
1.1.1

8 months ago

1.1.0

8 months ago

1.0.0

8 months ago

2.1.0

7 months ago

2.0.0

7 months ago

0.1.0

9 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.1

9 months ago

0.0.1

9 months ago