Skip to content

A Mocha plugin that generates coverage data for CircleCI's Smarter Testing.

License

Notifications You must be signed in to change notification settings

circleci/mocha-circleci-coverage

Repository files navigation

mocha-circleci-coverage

A Mocha plugin that generates coverage data for CircleCI's Smarter Testing.

Usage

This plugin uses the v8 JS engine Profiler APIs to collect coverage.

Install the plugin.

pnpm add -D jsr:@circleci/mocha-circleci-coverage

Add the custom hook to the .mocharc.js file:

module.exports = {
  require: ['@circleci/mocha-circleci-coverage'],
};

Run tests with the CIRCLECI_COVERAGE env to collect coverage.

CIRCLECI_COVERAGE=coverage.json mocha

Development

Install and use current node version.

NODE_VER=$(cat ./.nvmrc)
nvm install $NODE_VER
nvm use $NODE_VER

Install dependencies with pnpm.

pnpm install

Build the plugin.

pnpm build

Run tests.

pnpm test

About

A Mocha plugin that generates coverage data for CircleCI's Smarter Testing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •