Skip to content

Commit 0375932

Browse files
hi-ogawaclaude
andauthored
chore: warn agents not to use pnpm test with double hyphens -- (#9805)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d93a1c0 commit 0375932

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ Vitest is a next-generation testing framework powered by Vite. This is a monorep
3535
- **Core directory test**: `CI=true pnpm test <test-file>` (for `test/core`)
3636
- **Browser tests**: `CI=true pnpm test:browser:playwright` or `CI=true pnpm test:browser:webdriverio`
3737

38+
**IMPORTANT: Do NOT use `--` when passing test filters to pnpm.**
39+
Using `--` causes pnpm to drop the filter, resulting in a full test run instead of a filtered one.
40+
41+
```bash
42+
# WRONG - runs ALL tests (filter is ignored):
43+
pnpm test -- basic.test.ts -t 'expect'
44+
45+
# CORRECT - runs only matching tests:
46+
pnpm test basic.test.ts -t 'expect'
47+
```
48+
3849
When writing tests, AVOID using `toContain` for validation. Prefer using `toMatchInlineSnapshot` to include the test error and its stack. If snapshot is failing, update the snapshot instead of reverting it to `toContain`.
3950

4051
If you need to typecheck tests, run `pnpm typecheck` from the root of the workspace.

0 commit comments

Comments
 (0)