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

VSIX Vitest Extension not providing UI button or recognizing tests #286

Closed
6 tasks done
mujevich opened this issue Mar 12, 2024 · 13 comments
Closed
6 tasks done

VSIX Vitest Extension not providing UI button or recognizing tests #286

mujevich opened this issue Mar 12, 2024 · 13 comments

Comments

@mujevich
Copy link

mujevich commented Mar 12, 2024

Describe the bug

I had initially set up my project using the now deprecated Vitest Extension, and have now migrated to the currently supported version

My issue is that after migrating, my test no longer have the Play / Debug options next to them and the tests don't seem to be recognized. I'm still able to run my tests via the command line however.

image

Reproduction

N.A

System Info

"vitest.enable": true,
"vitest.changeBackgroundColor": true,
"vitest.commandLine": "yarn test",
"vitest.watchOnStartup": true,
"vitest.debugExclude": [
    "<node_internals>/**",
    "**/node_modules/**"
]

Used Package Manager

yarn

Validations

Copy link

Hello @mujevich. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.

@mujevich
Copy link
Author

mujevich commented Mar 12, 2024

I'm not sure how it would be possible to reproduce my local VS setup, outside of providing the vitest settings

@mujevich mujevich closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
@mujevich mujevich reopened this Mar 12, 2024
@StarpTech
Copy link

I have the same issue. Can be reproduced with https://github.com/wundergraph/cosmo Open it from the root and navigate to https://github.com/wundergraph/cosmo/blob/main/cdn-server/cdn/test/cdn.test.ts

@mujevich
Copy link
Author

Thanks a ton for that @StarpTech !!

@ffMathy
Copy link
Collaborator

ffMathy commented Mar 12, 2024

I have a strong feeling this will become way better after #253 is merged.

@mujevich
Copy link
Author

Also potentially related to #285, when I restarted my app I did see a similar error

image

@sheremet-va
Copy link
Member

This should work in pre-release 0.5.0 and higher. Note that the extension now requires Vitest 1.4.0 or higher.

If you still have the issue, please open a new issue with a reproduction.

@StarpTech
Copy link

pre-release 0.5.0 is not available on the marketplace.

@sheremet-va
Copy link
Member

pre-release 0.5.0 is not available on the marketplace.

https://marketplace.visualstudio.com/items?itemName=vitest.explorer

Screenshot 2024-03-15 at 20 40 49

@StarpTech
Copy link

StarpTech commented Mar 15, 2024

Hi, I tested pre-release 0.5.0 and it is still not functional. I also upgraded to vitest 1.4.0 and reload vscode

If you still have the issue, please open a new issue with a reproduction.

Why should we open another one if this issue has not been solved?

image

@sheremet-va
Copy link
Member

sheremet-va commented Mar 15, 2024

In your case, the problem is the monorepo structure. You define workspace configurations for your pnpm workspace, but you don't do the same for Vitest workspace - I would recommend adding a vitest.workspace file to improve performance of Vitest, at least: https://vitest.dev/guide/workspace.html

There are other issues at play that I will push the fix for (Released in 0.5.3), but I would strongly recommend adding a workspace configuration.

@StarpTech
Copy link

Hi, I have defined a workspace file but it still doesn't work.

export default ['controlplane', 'shared', 'cli', 'composition'];

@StarpTech
Copy link

It worked. I also had to install vitest in the root. Thank you.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 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

4 participants