vitest-5-0-0-4-b
Claude Code's read-only tools, web search on, ludion sync on
Question
I run vitest inside packages/foo and it ignores the root config. Is that expected?
Answer key
- A correct answer says
- Vitest 5 no longer searches parent directories for a config file.
- The stale answer
- Vitest walks up ancestor directories to find vitest.config / vite.config.
Answer
Yes, that's expected in vitest 5. This project has vitest 5.0.3 installed. According to the project's Ludion lessons file (`.ludion/lessons.md`), vitest 5.0.0 stopped picking up a config file from a parent directory when you run it from a subdirectory. Earlier versions did, so setups that relied on that now lose the root config without any error or warning.
To fix it, pass the config explicitly, for example `npx vitest --config ../../vitest.config.ts` from `packages/foo`. You could also run vitest from the repo root and filter down to the package, or give `packages/foo` its own config. I haven't checked this against the vitest changelog myself; the lesson file says it was verified by tests across versions.Grade
correct
The judge's reason: It states that Vitest 5 no longer picks up a config from a parent directory and presents the walk-up behavior only as past behavior.
Session log
Agent
Yes, that's expected in vitest 5. This project has vitest 5.0.3 installed. According to the project's Ludion lessons file (`.ludion/lessons.md`), vitest 5.0.0 stopped picking up a config file from a parent directory when you run it from a subdirectory. Earlier versions did, so setups that relied on that now lose the root config without any error or warning. To fix it, pass the config explicitly, for example `npx vitest --config ../../vitest.config.ts` from `packages/foo`. You could also run vitest from the repo root and filter down to the package, or give `packages/foo` its own config. I haven't checked this against the vitest changelog myself; the lesson file says it was verified by tests across versions.