Skip to content

Commit 5c74359

Browse files
committed
Initial commit
0 parents  commit 5c74359

13 files changed

+2031
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.next/
2+
/node_modules
3+
/playwright/.cache/
4+
/playwright/results/
5+
next-env.d.ts
6+
*.tsbuildinfo

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
This is an example of a Next.js project with Playwright code coverage enabled through the [monocart-reporter](https://github.com/cenfun/monocart-reporter).
2+
3+
## Setup and testing
4+
5+
> When debugging, you can use [`./start.sh`](/start.sh) to make sure you're working with a fresh environment.
6+
7+
### Install dependencies
8+
9+
```bash
10+
npm install
11+
```
12+
13+
### Build and serve app
14+
15+
```bash
16+
npm run build
17+
npm run start
18+
```
19+
20+
### Run Playwright tests
21+
22+
```bash
23+
npm run test
24+
```
25+
26+
> You can open the coverage report at `/playwright/results/index.html` in your browser.
27+
28+
## Instructions for your project
29+
30+
- [Code](/playwright.config.ts#L13-L18) Set up your `playwright.config.ts` with the proper `entryFilter` and `sourceFilter`.
31+
- [Code](/next.config.js#L3-L6) Update your Webpack config to set `config.devtool` to `"source-map"`.
32+
- [Code](/tests/home.spec.ts#L4-L11) Include the `beforeEach` and `afterEach` coverage collection in each of your test files.

biome.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"formatter": {
7+
"enabled": true
8+
},
9+
"linter": {
10+
"enabled": true,
11+
"rules": {
12+
"recommended": true
13+
}
14+
}
15+
}

next.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
webpack: (config) => {
4+
config.devtool = "source-map";
5+
return config;
6+
},
7+
};
8+
9+
module.exports = nextConfig;

0 commit comments

Comments
 (0)