-
-
Notifications
You must be signed in to change notification settings - Fork 318
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Prerequisites
- I'm using the latest version
- I've read the relevant documentation
- I've searched for existing issues
- I've checked the list of known issues
- I've read the issue reproduction guide
Reproduction url
https://codesandbox.io/p/devbox/h4h4v7
Reproduction access
- I've made sure the reproduction is publicly accessible
Description of the issue
Vitest correctly recognizes relative paths to setupFiles from a root Vitest config file. However, if you use Vitest's Test Projects feature, relative paths from the project-level config files are not resolved correctly:
Root Vitest config (vitest.config.mts)
export default defineConfig({
test: {
projects: ["app/vitest.config.mts"],
},
});Project config (app/vitest.config.mts)
export default defineConfig({
test: {
setupFiles: ["./__test__/vitest.setup.ts"],
},
});Knip output
Unused files (1)
app/__test__/vitest.setup.ts
Unresolved imports (1)
./__test__/vitest.setup.ts app/vitest.config.mtsMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working