Skip to content

Commit 715530c

Browse files
committed
docs: add test folder layout explanation and E2E test section to README
- Document Vitest vs Playwright test locations and purposes - Add E2E test section with `pnpm test:e2e` command - Clarify that `test/browser/**` uses Vitest over HTTP, not Playwright - Update peer dependency range to include Next.js 16.0.3
1 parent 7df0521 commit 715530c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ To run all tests you can use the following command:
214214
pnpm build && pnpm test
215215
```
216216

217+
Folder layout / runners:
218+
219+
- **Vitest** (unit + integration) lives in `src/**/*.test.ts(x)` and `test/**`.
220+
- **Playwright** (E2E) lives in `tests/**` (see `playwright.config.ts`).
221+
- `test/browser/**` contains Vitest tests that hit a running Next.js app over HTTP. Despite the folder name, this is not Playwright and does not use Vitest browser mode.
222+
217223
### Unit tests
218224

219225
To run unit tests you can use the following command:
@@ -230,6 +236,14 @@ To run integration tests you can use the following command:
230236
pnpm build && pnpm test:integration
231237
```
232238

239+
### E2E tests (Playwright)
240+
241+
To run Playwright tests (`tests/**`) you can use:
242+
243+
```bash
244+
pnpm test:e2e
245+
```
246+
233247
The integration tests will start a Next.js server and test the caching handler. You can modify testing behavior by setting the following environment variables:
234248

235249
- SKIP_BUILD: If set to true, the integration tests will not build the Next.js app. Therefore the nextjs app needs to be built before running the tests. Or you execute the test once without skip build and the re-execute `pnpm test:integration` with skip build set to true.

test/integration/next-app-15-4-7/pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)