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

Watch mode skips all tests in a clean SvelteKit project #171

Closed
sjoerdvanBommel opened this issue Jul 11, 2023 · 5 comments
Closed

Watch mode skips all tests in a clean SvelteKit project #171

sjoerdvanBommel opened this issue Jul 11, 2023 · 5 comments
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@sjoerdvanBommel
Copy link

sjoerdvanBommel commented Jul 11, 2023

Describe the bug
The VSCode Vitest plugin fails to execute any unit tests when running in watch mode (for example in a clean SvelteKit project).

To Reproduce
Steps to reproduce the behavior:

  1. Create a clean TypeScript skeleton SvelteKit project with all options included: npm create svelte@latest test-app
  2. cd test-app
  3. npm i
  4. (Optional) Run the tests with the default runner. This works as expected
    image
  5. Run the tests using watch mode
    image
  6. All tests are skipped for some reason. At the top and bottom, it mentions "0/0 tests passed (0.00%)" and "0/0 passed (0%, all skipped)"
    image

Expected behavior
Similar behavior to when I run the tests without watch mode, but instead affected tests should be re-run.

Environment

(Paste info.txt content generated by the example project)

  • OS: Windows 11 (OS build 22621.1848)
  • VSCode version: 1.80.0
  • Vitest version: ^0.32.2
  • Vitest plugin version: v0.2.42

Let me know if anyone is able to reproduce this behavior. Thanks in advance! :)

@sjoerdvanBommel sjoerdvanBommel added the p3-minor-bug An edge case that only affects very specific usage (priority) label Jul 11, 2023
@sjoerdvanBommel
Copy link
Author

Two more points:

  • I disabled all other VSCode extensions
  • Once watch mode is running (it does run, it just skips all tests), starting any of the other tests does not trigger anything. You have to manually stop watch mode before you can run any tests via the plugin. You can do this by clicking the button below
    image

@sjoerdvanBommel
Copy link
Author

sjoerdvanBommel commented Jul 11, 2023

Couldn't find a related issue before, but found one now: #44
It seems to be broken since [email protected]. The tests run as expected until [email protected]
At least there is a workaround for now :) Edit: It seemed to work as expected after downgrading, but now watch mode only runs the tests once and doesn't react to any changes

@mcavigelli
Copy link

Let me know if anyone is able to reproduce this behavior. Thanks in advance! :)

We are using vitest plugin 0.2.42, vitest 0.33.0, vite 4.4.3 and VSCode 1.80.0 on windows.
We have the same behaviour. It can easily be reproduced by setting up a project as in the vitest repository in the folder https://github.com/vitest-dev/vitest/tree/main/examples/basic.

@callmeberzerker
Copy link

I have the same issue on Windows 11.

@sheremet-va
Copy link
Member

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

@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.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

4 participants