-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: nx support #231
feat: nx support #231
Conversation
4bd15da
to
8d4f395
Compare
This is also a big source of bad reviews: https://marketplace.visualstudio.com/items?itemName=ZixuanChen.vitest-explorer&ssr=false#review-details |
@ffMathy is it intended, with these changes to support nx, that the working directory when running a test is the containing package rather than the monorepo root or it is still required to e.g. use vscode workspaces to achieve that? |
You can use a vitest.workspace.ts file and it should work fine from the NX monorepo root. But there are some known bugs right now that are being fixed in the next release in the coming days. Also note that the current extension has been deprecated and there is a new link to the new extension. |
Thanks @ffMathy. I'm using v0.3.0 of https://marketplace.visualstudio.com/items?itemName=vitest.explorer which I think has this change in it. Using the new sample, |
0.3.0 doesn't have the bugfixes that are incoming. Hmmm I didn't know about the working directory thing. Perhaps I should make a fix for that and create another test for that scenario. Before my change, NX tests wouldn't run at all. So at least there's progress. Can you file an issue with the working directory problem? |
Will do! Thank you! |
Builds on top of #230, so that should probably be merged first.
I had some issues getting NX working, so this PR adds a new NX sample.
The issue I was having turned out to be that when Vite runs within the sample directory, it tries to traverse upwards in directories and then would catch the root repo's
vite.config.ts
file, which would have anexclude
section that would exclude**/src/**
and others.Now the global vite config has been renamed to avoid it accidentally being picked up in the samples.