Jest Puppeteer Coverage Example
March 24, 2024 ยท View on GitHub
jest-puppeteer coverage reports with monocart coverage reports
Step 1, Install
npm i monocart-coverage-reports jest-puppeteer puppeteer jest -D
Step 2, Collect V8 Coverage Data
Collect coverage data with hooks beforeAll and afterAll, see
Step 3, Generate Coverage Reports
- Create jest global-setup.js and global-teardown.js for generating coverage reports, see jest.config.js
- Set coverage options in config file mcr.config.js
npm run test
The coverage report will be found here: coverage-reports/index.html
Check monocart coverage reports for more coverage options.