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

Package detail

jest-md-dashboard

tasshi-me10.8kMIT0.8.0TypeScript support: included

Generating a pretty Markdown dashboard for Jest

jest, reporter, markdown

readme

jest-md-dashboard

npm version codecov test lint License: MIT

Generating a pretty Markdown dashboard for Jest

Table of Contents

Example

See https://github.com/tasshi-me/jest-md-dashboard/issues/20

Installation

npm

npm install -D jest-md-dashboard

yarn

yarn add -D jest-md-dashboard

pnpm

pnpm add -D jest-md-dashboard

Usage

Add reporters field in jest.config.js.

const config = {
  reporters: ["default", "jest-md-dashboard"],
};
module.exports = config;

Run jest and the dashboard is generated to test-dashboard.md.

With options

const config = {
  reporters: ["default", ["jest-md-dashboard", { title: "My Dashboard" }]],
};
module.exports = config;

Options

Name Type Default Description
title string "Test Dashboard" The title of a dashboard.
It will be printed at the top of the markdown output.
outputPath string test-dashboard.md The file path to output dashboard.
If you want to output to stdout, specify -.
permalinkBaseUrl string undefined Override baseUrl of permalink.
See Permalink section for more information.

jest-md-dashboard generates permalink to test files on GitHub (or other services) by default.

It tries to find git information from the following sources.

  1. permalinkBaseUrl option
  2. (on GitHub Actions) environment variables
  3. (in git repository) repository config

1. permalinkBaseUrl option

If permalinkBaseUrl is specified on jest config, jest-md-dashboard generates permalink using it.

Specify this option when if generated permalinks are incorrect.

The URL must have a trailing slash.

e.g. https://github.com/tasshi-me/jest-md-dashboard/blob/

2. Run on GitHub Actions

If jest runs on GitHub Actions, jest-md-dashboard refers to the the environment variables.

3. Run in git repository

If jest runs in a git repository, jest-md-dashboard refers to the local repository config.

Contribution

We appreciate your help!

License

changelog

Changelog

0.8.0 (2024-02-26)

⚠ BREAKING CHANGES

  • drop Node 14 and 16 support (#469)

Bug Fixes

  • deps: update dependency typescript to v5 (#289) (4d513f7)

Miscellaneous Chores

0.7.2 (2023-01-11)

Bug Fixes

  • deps: Bump json5 from 1.0.1 to 1.0.2 (#260) (0ea87ca)

0.7.1 (2022-09-08)

Bug Fixes

  • deps: update dependency isomorphic-git to ^1.19.2 (#88) (206b384)
  • deps: update dependency isomorphic-git to ^1.19.3 (#99) (ea6f642)
  • deps: update dependency isomorphic-git to ^1.21.0 (#101) (c9bbcc3)

0.7.0 (2022-08-16)

Features

  • sort test results alphabetically by file path (#68) (051e9e2)

Bug Fixes

  • deps: update dependency isomorphic-git to ^1.19.1 (#58) (9ce3564)
  • make sort order of test result ascending (#83) (cbb5475)

0.6.1 (2022-07-08)

Documentation

  • add example to README.md (e2cd19e)

0.6.0 (2022-07-03)

Features

  • show summary for each test files (7996c7e)
  • show the status icon for ancestors. (a7550f8)
  • show the status icon for each test. (59f9613)

Bug Fixes

  • inherit silent from jest global config (d5876dd)

0.5.0 (2022-07-03)

⚠ BREAKING CHANGES

  • remove permalink option and add permalinkBaseUrl (#37)
  • output to file by default (#34)

Features

  • output to file by default (#34) (ed723bf)
  • remove permalink option and add permalinkBaseUrl (#37) (a9fdceb)

Bug Fixes

  • change default dashboard title (dc5d2cd)

0.4.0 (2022-06-29)

Features

Bug Fixes

  • use config.rootDir to generate file path (ec74a88)

0.3.1 (2022-06-28)

Bug Fixes

  • show outputPath when file generated (7ff155f)

0.3.0 (2022-06-27)

⚠ BREAKING CHANGES

  • convert to pure ESM package (#11)

Miscellaneous Chores

0.2.0 (2022-06-25)

Features

Bug Fixes

  • build package before publish (e3ac569)

0.1.0 (2022-06-24)

Features

  • MarkdownDashboardReporter (d89ace4)

Miscellaneous Chores