coverage-pretty-html-reporter
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

coverage-pretty-html-reporter

[!WARNING] This package is still in the experimental phase. You can expect new functionalities, but with this comes the possibility of more frequent errors

Directory summary (light theme) File coverage (dark theme)
Summary Coverage

Installation

You can use your favorite package manager

npm i -D coverage-pretty-html-reporter
yarn add -D coverage-pretty-html-reporter
pnpm add -D coverage-pretty-html-reporter
bun add -D coverage-pretty-html-reporter

Then configure nyc / c8 to use coverage-pretty-html-reporter

nyc --reporter=coverage-pretty-html-reporter mocha # ...
c8 --reporter=coverage-pretty-html-reporter mocha # ...

If you are using jest / vitest or other framework you may place correct config ex.:

/** @type {import('jest').Config} */
const config = {
  coverageReporters: ['coverage-pretty-html-reporter'],
};
import { defineConfig } from "vitest/config";
export default defineConfig({
  plugins: [],
  test: {
    coverage: {
      enabled: true,
      // @ts-expect-error
      reporter: ["coverage-pretty-html-reporter"],
    },
  },
});

Reading coverage report

coverage-pretty-html-reporter does not support viewing web-page locally (via file:// protocol) (i.e. double clicking the .html file). You need to publish coverage directory on local network ex.:

# When using npm
npx http-server ./coverage
# When using pnpm
pnpm dlx http-server ./coverage
# When using bun
bunx http-server ./coverage

/coverage-pretty-html-reporter/

    Package Sidebar

    Install

    npm i coverage-pretty-html-reporter

    Weekly Downloads

    10

    Version

    0.0.5

    License

    none

    Unpacked Size

    568 kB

    Total Files

    9

    Last publish

    Collaborators

    • akcyp