-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
[not support vitest@v0.18.0] test successfully, but loading infinitely. #55
Comments
After downgrading the vitest to @0.15.2, it works well. |
The last working version is |
Hi @SoonIter ,Please upgrade |
OK, it now works well with |
The latest vitest extension release, v0.2.20 (from 15 days ago), doesn't work with vitest v0.18.1 for me. Just get an infinite spinner. Try the example project linked to above with this: "devDependencies": {
"envinfo": "^7.8.1",
"vite": "^3.0.0",
"vitest": "^0.18.1"
} |
Same issue as @beorn. I think this issue should be re-opened. |
same! |
pnpm monorepo here with vitest |
Greetings. Same here. I can run the tests and they pass from the terminal. However, running them from the extension gets the indicator spinning forever. BTW, I also cloned your repo to test with your samples and the issue still exists. macOS Big Sur 11.6.5 "typescript": "^4.7.4", Please, help. |
Same problem for me... |
check the docs of Vitest vitest docs options Do not watch option |
@rokbot So it seems it doesn't hang anymore - it runs - but test results are not found. It helps troubleshooting the issue, but it's not a workaround as far as I can see? |
I wish this can be fixed soon ~ |
The issue here is actually fixed and the "Test result not found" error comes from wrong configuration. This extension depends on the watch function of vitest. We aren't supposed to run it with |
@Pustinyak I tried:
they all have the same issue. |
@Pustinyak what version of |
Hey @xieyuheng, I should've mentioned that my solution is better suited for monorepo. I see in your |
Any update on this? This extension seems broken for the latest 3 months of vitest releases (starting with v0.17.0), and there are quite a few duplicated issues/reports about it. I haven't found a workaround... If you have any — please share. |
@beorn This seems to be fixed with some workaround/tool and [kudos to the development team 🎉 ]. I will edit some of my posts to match the current state of this and help others troubleshoot this issue |
I tried once the solution proposed by @Pustinyak but sadly doesn't work for me |
The steps that worked for me and probably for you are these:
|
I am also experiencing this issue. Using vitest One important note is that on working versions ( On later versions, "WS Open" never happens, and instead "WS Close" gets spammed near endlessly. Looking at the Release notes for |
adding to @c00 reply, a temporary workaround is to prepend |
I fixed a lot of this a few days ago. To be clear, this all broke with the release of Vite 3.0 (3.0.0-alpha.11, to be exact). It happened with this commit where they changed the default host from If anyone is interested, I can post the modified vscode extension file in a fork of this project. Alternatively, there is another option for people who don't want to modify their extension. Here's a little wrapper for vitest.mjs that I wrote that intercepts calls to vitest, "fixes" the arguments passed in, and passes them along to the real vitest.mjs. // node_modules/vitest/vitest.mjs
import path from 'path';
import { spawnSync } from 'node:child_process';
const [ node, module, ...origArgs ] = process.argv;
const args = origArgs.map((arg, i) => {
if (arg === '--api') {
return '--api.port';
}
if (origArgs[i - 1] === '-t') {
return arg.replace(/[$^+?()[\]]/g, '\\$&');
}
if (/\.(?:js|mjs|cjs|ts|mts|cts|jsx|tsx)$/.test(arg)) {
const cwd = process.cwd();
return path.join(cwd, path.relative(cwd, arg));
}
return arg;
});
if (!args.includes('--api.host')) {
args.push('--api.host', '127.0.0.1');
}
spawnSync(node, [module.replace(/\.m?js$/, '.real$&'), ...args], { stdio: [0, 1, 2] }); To use it, you can simply install the latest vite and vitest, rename |
@falynx great, but I already try on window and it seem not work, did I do correct? |
@hiepxanh Hmm, your file setup looks fine, but you seem to be receiving a few different errors that may not be related. So instead of starting with your particular setup, why don't we start from the vitest sample project as a baseline. Here are the steps:
I see that you're using
All of that is working fine for me here on my Windows 11 system. If it's not working for you, then I'm not sure what to tell you. If it is, then that should be a good baseline for you to debug the issue with your larger project. |
I just submitted a pull request to migrate this extension to Vite 3.0. If you prefer to fix/modify your extension rather than using the vitest wrapper script above, follow these steps:
Only tested on Windows 11. |
merged @falynx 💘 you did great, good job |
For me it's working out of the box now.
If this doesn't help, what OS are you on? |
Describe the bug
A clear and concise description of what the bug is.
I installed vitest V0.18.0,and it doesn`t work.
To Reproduce
Steps to reproduce the behavior on the example project:
but the extension works fail
Expected behavior
work well
Screenshots
Maybe the problem is to run-once or run-watch.
Version 0.2.20
The text was updated successfully, but these errors were encountered: