vitest-jetbrains-plugin
vitest-jetbrains-plugin copied to clipboard
Configurable vitest config
Thanks for the plugin!
With jest we were able to provide a custom configuration file and custom arguments in the Run/Debug configurations.
Example:

The use-case is that we would like to have two different vitest configs, one for unit tests and one for integration tests as they do different things (e.g. integration tests need more global setup + longer test timeouts + other things).
Is it possible to support this in the plugin as well?
@krivachy Now Vitest Runner plugin does not use Run/Debug configurations to run test, and it uses CLI+Console to run Vitest. A solution is to tell the plugin choose Vitest config file to run tests, for example you should add vitest configurations in package.json.
"vitest": {
"configs": {
"vitest-ci.config.ts": "tests/ci/**"
}
}
Do you have other suggestions to choose configs?
@linux-china I'm having an issue with a mono repo.. I have both "workspaces" declared in the repo root package.json but I also have a project specs vitest.config.ts declared in the sub-project. But when a test on intergration.test.ts it doesn't pick up the project config but rather it picks up the root config.
.
├── package.json
├── vitest.config.ts
└── packages/
└── my-project/
├── package.json
├── vitest.config.ts <- uses mergeConfig
└── tests/
└── intergration.test.ts
Looking at this line it seems that the logic should be reversed or atleast provide an option to force using the project config vs root when using workspaces.
@linux-china I'm having an issue with a mono repo.. I have both "workspaces" declared in the repo root package.json but I also have a project specs vitest.config.ts declared in the sub-project. But when a test on
intergration.test.tsit doesn't pick up the project config but rather it picks up the root config.. ├── package.json ├── vitest.config.ts └── packages/ └── my-project/ ├── package.json ├── vitest.config.ts <- uses mergeConfig └── tests/ └── intergration.test.tsLooking at this line it seems that the logic should be reversed or atleast provide an option to force using the project config vs root when using workspaces.
try this: https://github.com/linux-china/vitest-jetbrains-plugin/issues/30#issuecomment-1250483979