This is an example of a Next.js project with Playwright code coverage enabled through the monocart-reporter.
- (Code) Set up your
playwright.config.ts
for themonocart-reporter
. - (Code) Update your Webpack config to set
config.devtool
to"source-map"
. - (Code) Include the
beforeEach
andafterEach
coverage collection in each of your test files, for client coverage. - (Code) Include
globalTeardown.js
to collect server coverage.
When debugging, you can use
./start.sh
to make sure you're working with a fresh environment.
bun install
bun dev
bun test:e2e
After bun test:e2e
has finished, open /playwright/results/coverage/index.html
in your browser to view the client-side coverage report.