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 with vite-jest --watch #32

Open
zigomir opened this issue Dec 7, 2021 · 8 comments
Open

Watch mode with vite-jest --watch #32

zigomir opened this issue Dec 7, 2021 · 8 comments

Comments

@zigomir
Copy link

zigomir commented Dec 7, 2021

I can only press a once to re-run the tests, then after second run I get

  ● Test suite failed to run

    Server is not running.

and can't re-run tests anymore.

@haoqunjiang
Copy link
Owner

Do you have a reproduction repo? I can't reproduce this in my projects.

@zigomir
Copy link
Author

zigomir commented Dec 7, 2021

Hmm, happy to report I can't reproduce this anymore and --watch works as expected 🎉
Maybe I had some old vite/jest cache or something 🤷‍♂️

Thank you for this amazing library though, I had no real issues porting from jest to vite-jest and performance bump is

time npx jest --no-cache

Executed in   20.00 secs    fish           external
   usr time   92.46 secs    0.41 millis   92.46 secs
   sys time    7.70 secs    1.10 millis    7.70 secs

vs

time npx vite-jest --no-cache

Executed in    8.98 secs    fish           external
   usr time    7.31 secs    0.38 millis    7.31 secs
   sys time    2.39 secs    1.35 millis    2.39 secs

@zigomir zigomir closed this as completed Dec 7, 2021
@zigomir
Copy link
Author

zigomir commented Dec 7, 2021

Spoke too soon. Watch seems to be working but when I change test file that should fail I still only see tests passing. I'm using vue 3 with typescript and "@vue/test-utils": "^2.0.0-rc.17".

@zigomir zigomir reopened this Dec 7, 2021
@zigomir
Copy link
Author

zigomir commented Dec 7, 2021

I was now able to reproduce

  ● Test suite failed to run

    Server is not running.

running npx vite-jest --watch inside vite-jest/examples/vue-app-ts directory of this repo.

@haoqunjiang
Copy link
Owner

Got it. It's due to the cache of the Vite dev server. I found an easy fix. Will patch it soon.

@zigomir
Copy link
Author

zigomir commented Jan 5, 2022

@sodatea Actually I'm still getting this, but only every second re-run.

Output this time is:

  ● Test suite failed to run

    The server is not running

      at WebSocketServer.<anonymous> (node_modules/.pnpm/[email protected]/node_modules/ws/lib/websocket-server.js:155:14)
      at emitClose (node_modules/.pnpm/[email protected]/node_modules/ws/lib/websocket-server.js:442:10)

I'm using [email protected] and [email protected].

@haoqunjiang haoqunjiang reopened this Jan 5, 2022
@straach
Copy link

straach commented Apr 8, 2022

I second this problem. Using the following:

"vite": "2.8.6",
"vite-jest": "0.1.4"

@erik-with-a-k
Copy link

Also repro-ing this on

"vite": "2.9.6",
"vite-jest": "0.1.4"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants