Claude Opus 5.5

vitest-5-0-0-4-b

Claude Code's read-only tools, web search on, ludion sync off

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.

The change's lesson

Answer

Yes, that's expected. Vitest, like Vite, only looks for `vitest.config.*` or `vite.config.*` in the directory you run it from (its root). It doesn't search parent directories, so running it inside `packages/foo` with no config there means it uses the defaults.

You can fix this in one of three ways:

- **Point at the root config:** run `vitest --config ../../vitest.config.ts`.
- **Add a config to the package:** create a small `packages/foo/vitest.config.ts` that imports the root config and extends it with `mergeConfig` from `vitest/config`.
- **Run from the repo root:** define the packages with `test.projects` (called "workspace" in older versions) in the root config, then run `vitest --project foo` from the root.

Answering cost $0.06.

Grade

correct

The judge's reason: It says Vitest does not search parent directories and only looks in the root, which matches the key and does not present the stale walk-up behavior.

The judge's log

Session log

What the agent wrote, the tools it called, and what they returned, from docs/bench/2026-10-11-done3/runs/B-project/vitest-5-0-0-4-b.jsonl. Thinking and the session's settings are left out. The raw log

  1. Agent

    Yes, that's expected. Vitest, like Vite, only looks for `vitest.config.*` or `vite.config.*` in the directory you run it from (its root). It doesn't search parent directories, so running it inside `packages/foo` with no config there means it uses the defaults.
    
    You can fix this in one of three ways:
    
    - **Point at the root config:** run `vitest --config ../../vitest.config.ts`.
    - **Add a config to the package:** create a small `packages/foo/vitest.config.ts` that imports the root config and extends it with `mergeConfig` from `vitest/config`.
    - **Run from the repo root:** define the packages with `test.projects` (called "workspace" in older versions) in the root config, then run `vitest --project foo` from the root.