jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.84k stars 295 forks source link

[Feature Request] Support Monorepo single root workspace #1044

Closed ciandt-crodrigues closed 1 year ago

ciandt-crodrigues commented 1 year ago

Environment

VSCode - Any version

Prerequisite

Expected Behavior

use the nearest configuration (parent packages.json , jest.config.ts) to run the tests

Actual Behavior

It requires multi root workspace to resolve the node_modules/.bin/jest and config


The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...

connectdotz commented 1 year ago

Hi, perfect timing. We just pre-released v6.0.0 with virtualFolders that specifically targeted these kinds of use cases. It doesn't go by the nearest jest config but require specific jest config called jest.virtualFolders, which not only enabled users to run multiple jest configs within the single root workspace, but also supported all jest settings for each virtualFolder, such as autoRun etc. Please feel free to give it a try: https://github.com/jest-community/vscode-jest/blob/master/release-notes/release-note-v6.md#v600-pre-release