No proper coverage with Vitest 4
🐛 Bug
**Summary**
With Vitest 4 there is no proper coverage during mutation testing runs. Completely uncovered functions are mutated and affect the resulting score as well as the column "No Coverage" is all zeros.
Simply downgrading Vitest to the 3 version is enough to fix the problem
**Stryker config**
```json
{
"$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
"_comment": "This config was generated using 'stryker init'. Please take a look at: https://stryker-mutator.io/docs/stryker-js/configuration/ for more information.",
"packageManager": "pnpm",
"reporters": [
"html",
"clear-text",
"progress"
],
"ignorePatterns": [".*"],
"testRunner": "vitest",
"testRunner_comment": "Take a look at https://stryker-mutator.io/docs/stryker-js/vitest-runner for information about the vitest plugin.",
"coverageAnalysis": "perTest",
"plugins": [
"@stryker-mutator/vitest-runner"
]
}
```
**Test runner config**
No vitest config was used
**Stryker environment**
```
+-- @stryker-mutator/core@9.6.0
+-- @stryker-mutator/vitest-runner@9.6.0
+-- vitest@4.1.2
```
**Test runner environment**
```shell
pnpm vitest
```
```json
// no config is used for vitest
```
**Your Environment**
| software | version(s)
| ---------------- | -------
| node | v24.13.0 (also tested on v22)
| pnpm | 10.28.0
| Operating System | Linux 6.18.10 - NixOS (also tested on MacOS)
**Add stryker.log**
[stryker.log](https://github.com/user-attachments/files/26305716/stryker.log)
**Minimal Reproducible Example**
[code.zip](https://github.com/user-attachments/files/26305718/code.zip)
关闭于 2026-04-10 5 条评论