vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
13.15k stars 1.19k forks source link

fix: stop the runner before restarting, restart on workspace config change #6859

Closed sheremet-va closed 3 weeks ago

sheremet-va commented 3 weeks ago

Description

Fixes #6738 FIxes #5327

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

Tests

Documentation

Changesets

netlify[bot] commented 3 weeks ago

Deploy Preview for vitest-dev ready!

Name Link
Latest commit 9641b6dc4fbc506753f8ebff67cd7f1f3290a7e2
Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/672a204e243cb40008f0926f
Deploy Preview https://deploy-preview-6859--vitest-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

sheremet-va commented 3 weeks ago

@hi-ogawa @AriPerkkio added the test. interested to know your opinion on the useFS helper

AriPerkkio commented 3 weeks ago

Looks handy and easy to read. Sometimes it's nicer to have static fixtures directory but in cases like this where they are not shared between multiple tests, re-creating fixtures on test run makes sense.

The reruns tests when configs change test case does a lot of file writing so it might be slow on CI. Looks like it did pass though.

sheremet-va commented 3 weeks ago

The reruns tests when configs change test case does a lot of file writing so it might be slow on CI. Looks like it did pass though.

Maybe we can emit the event manually instead of waiting then 🤔

sheremet-va commented 3 weeks ago

It takes 1200-1300ms in CI, the same locally for me. Takes the longest on Windows - 1700ms, but changing to use watcher.emit didn't improve times significantly 🤷🏻

sheremet-va commented 3 weeks ago

Should we cleanup root entirely? (though I might even want a mode with env var where it leaves files without being deleted to debug later)

Removing the root now.

But, looking at playwright's ones, they make use of a lot of small runInlineTest and it looks nice.

Added a similar helper!