Skip to content

michaelhays/playwright-nextjs-coverage-example

Repository files navigation

This is an example of a Next.js project with Playwright code coverage enabled through the monocart-reporter.

Instructions for your project

  • (Code) Set up your playwright.config.ts for the monocart-reporter.
  • (Code) Update your Webpack config to set config.devtool to "source-map".
  • (Code) Include the beforeEach and afterEach coverage collection in each of your test files, for client coverage.
  • (Code) Include globalTeardown.js to collect server coverage.

Setup and testing

When debugging, you can use ./start.sh to make sure you're working with a fresh environment.

Install dependencies

bun install

Serve app

bun dev

Run Playwright tests

bun test:e2e

Results

After bun test:e2e has finished, open /playwright/results/coverage/index.html in your browser to view the client-side coverage report.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published