Clear and concise description of the problem
Project configurations can be repetitive, it would be nice for us and for Vitest to have a clear path towards defining what is common and what is specific to that project in one place. Inline projects are a great tool for that, I'm so thankful they made it into Vitest.
However, extending doesn't quite work as I expected, here I expected the project to inherit globals: true:
{
test: {
globals: true,
workspace: [
{
test: {
name: "node",
environment: "node",
},
},
],
},
}
because otherwise any config defined at the root test is a noop when workspace exists, right?
Next I tried setting extends: true on the project to get it to work, but it didn't. I don't really know what it does by default, I suppose it's looking up the directory tree.
What did work was configuring extends: "./vitest.config.ts".
Suggested solution
I would like not having to configure extends on projects, I would like inheritance to just happen. If that makes sense for the direction of v3.
Alternative
Type definitions could be altered in a way that prohibits noop root configs in case workspace is defined, using a discriminated union.
Additional context
No response
Validations
Clear and concise description of the problem
Project configurations can be repetitive, it would be nice for us and for Vitest to have a clear path towards defining what is common and what is specific to that project in one place. Inline projects are a great tool for that, I'm so thankful they made it into Vitest.
However, extending doesn't quite work as I expected, here I expected the project to inherit
globals: true:because otherwise any config defined at the root
testis a noop whenworkspaceexists, right?Next I tried setting
extends: trueon the project to get it to work, but it didn't. I don't really know what it does by default, I suppose it's looking up the directory tree.What did work was configuring
extends: "./vitest.config.ts".Suggested solution
I would like not having to configure
extendson projects, I would like inheritance to just happen. If that makes sense for the direction of v3.Alternative
Type definitions could be altered in a way that prohibits noop root configs in case
workspaceis defined, using a discriminated union.Additional context
No response
Validations