vitest-5-0-0-13-b
Claude Code's read-only tools, web search on, ludion sync on
Question
What separator does Vitest's testNamePattern use between suite and test names?
Answer key
- A correct answer says
- In `-t` / testNamePattern, nested suite and test names are joined with `>`.
- The stale answer
- Suite and test names in the -t full name are joined with a space.
Answer
For the vitest 5.0.3 this project uses, `testNamePattern` (`-t`) is matched against the full test name. That name is the enclosing suite names plus the test name, joined with `" > "` (space, greater-than, space), which is the same string the reporter prints, e.g. `math > add > handles negatives`. Older Vitest versions joined the names with a single space (`math add handles negatives`), so patterns written for that format may silently stop matching after an upgrade.
I didn't check this myself: the `" > "` behaviour comes from the project's `.ludion/lessons.md` notes, and Vitest isn't in `node_modules` here, so I couldn't confirm it against the installed source. If it matters, run `vitest -t "suite > test"` once to see that it matches.Grade
correct
The judge's reason: It states names are joined with " > " as current and mentions the space separator only as older behavior.
Session log
Tool call: Grep
{ "pattern": "testNamePattern|fullTestName|getTaskFullName", "path": "C:\\Users\\haya0\\AppData\\Local\\Temp\\ludion-bench-oFnmd0\\work\\node_modules\\@vitest\\runner\\dist", "output_mode": "content", "head_limit": 20 }Tool output (error)
Path does not exist: C:\Users\haya0\AppData\Local\Temp\ludion-bench-oFnmd0\work\node_modules\@vitest\runner\dist. Note: your current working directory is C:\Users\haya0\AppData\Local\Temp\ludion-bench-oFnmd0\work.Agent
For the vitest 5.0.3 this project uses, `testNamePattern` (`-t`) is matched against the full test name. That name is the enclosing suite names plus the test name, joined with `" > "` (space, greater-than, space), which is the same string the reporter prints, e.g. `math > add > handles negatives`. Older Vitest versions joined the names with a single space (`math add handles negatives`), so patterns written for that format may silently stop matching after an upgrade. I didn't check this myself: the `" > "` behaviour comes from the project's `.ludion/lessons.md` notes, and Vitest isn't in `node_modules` here, so I couldn't confirm it against the installed source. If it matters, run `vitest -t "suite > test"` once to see that it matches.