# Fix vitest test running and debugging for v4 with backwards compatibility \(\#43241\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/d52defe35a6e5fde07257a67e049383437f538f1)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: d52defe35a6e5fde07257a67e049383437f538f1

Requested commit: d52defe35a6e5fde07257a67e049383437f538f1

Commit: d52defe35a6e5fde07257a67e049383437f538f1

Tree: 0f215966cf4d44b24df672880f9517f2d146b8a1

Author: Freddy Fallon

Committer: GitHub

## Message

```
Fix vitest test running and debugging for v4 with backwards compatibility (#43241)

## Summary

This PR updates the vitest test runner integration to use the modern
`--no-file-parallelism` flag instead of the deprecated
`--poolOptions.forks.minForks=0` and `--poolOptions.forks.maxForks=1`
flags.

## Changes

- Replaced verbose pool options with `--no-file-parallelism` flag in
both file-level and symbol-level vitest test tasks
- This change works with vitest v4 while maintaining backwards
compatibility with earlier versions (or 3 at least!)

## Testing

- Added test `test_vitest_uses_no_file_parallelism_flag` that verifies:
  - The `--no-file-parallelism` flag is present in generated test tasks
  - The deprecated `poolOptions` flags are not present
- Manually tested with both vitest v4 and older versions to confirm
backwards compatibility
- All existing tests pass

## Impact

This allows Zed users to run and debug vitest tests in projects using
vitest v4 while maintaining support for earlier versions.

Release Notes:

- Fixed vitest test running and debugging for projects using vitest v4

---------

Co-authored-by: Cole Miller <cole@zed.dev>
```

## Parents

- [79a8985a8e6ee98f1783a39496adf9f6dbc24701](https://git.cafe/gitcafe/zed/commit/79a8985a8e6ee98f1783a39496adf9f6dbc24701?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/d52defe35a6e5fde07257a67e049383437f538f1?format=markdown)
