Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vitest.workspace.json not discovering Tests #271

Closed
6 tasks done
ldrick opened this issue Feb 29, 2024 · 2 comments
Closed
6 tasks done

vitest.workspace.json not discovering Tests #271

ldrick opened this issue Feb 29, 2024 · 2 comments

Comments

@ldrick
Copy link

ldrick commented Feb 29, 2024

Describe the bug

I have a workspace like that:

./frontend/projectA/vite.config.ts
./frontend/projectB/vite.config.ts
./backend
./not-a-npm-project
./e2e-tests

Right now I'd like to use the ./vitest.workspace.json because this is not a monorepo, neither it works well with vscode multi-root-workspaces due to many old school setup not so easy to change.

Unfortunately vitest vscode doesn't recognize the file or at least tests from both frontend-projects do not show up.

Reproduction

This is the vitest.workspace.json:

["frontend/*/vite.config.ts"]

System Info

I am working within WSL2 hosted in Windows 11

Used Package Manager

npm

Validations

@ldrick
Copy link
Author

ldrick commented Mar 14, 2024

After trying little more around, I found vscode-jest#virtualfolders which provides enough to setup in the given folder structure.

If vitest would provide something like that, I could have 2 rootFolders (which indeed they are):

{
    "vitest.virtualFolders": [
        {
            "name": "Project A Unit Tests",
            "rootPath": "frontend/projectA/",
            "runMode": "on-demand",
            "vitestCommandLine": "npm run test --"
        },
        {
            "name": "Project B Unit Tests",
            "rootPath": "frontend/projectB/",
            "runMode": "on-demand",
            "vitestCommandLine": "npm run test --"
        }
    ]
}

@sheremet-va
Copy link
Member

sheremet-va commented Mar 15, 2024

The extension was rewritten from the ground up in #253.

It should now support vitest.workspace.json file out of the box. If you still have the bug with a pre-release version, please open a separate issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants