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

feat: reprint all tests, if one of the test files was deleted #1081

Merged
merged 9 commits into from Apr 3, 2022

Conversation

sheremet-va
Copy link
Member

Closes #1005

Debatable solution. I sometimes also was confused when after deleted a file, nothing happend. Maybe at least something should happen?

@netlify
Copy link

netlify bot commented Apr 2, 2022

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 9644a24
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/624955fd17a3250009e73af2
😎 Deploy Preview https://deploy-preview-1081--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 settings.

@antfu
Copy link
Member

antfu commented Apr 2, 2022

If you delete a source file, it should trigger the rerun for tests deps on it. but if you delete a test file, it should be ...deleted, isn't it? I think you can always rerun the tests by shortcuts. Consider in some projects they might have a lot of tests, delete to trigger the full rerun sounds a bit weird behavior to me.

Or maybe if you really need some feedback, we could simply print xxxx.test.ts has been deleted. WDYT?

@sheremet-va
Copy link
Member Author

If you delete a source file, it should trigger the rerun for tests deps on it. but if you delete a test file, it should be ...deleted, isn't it? I think you can always rerun the tests by shortcuts. Consider in some projects they might have a lot of tests, delete to trigger the full rerun sounds a bit weird behavior to me.

Or maybe if you really need some feedback, we could simply print xxxx.test.ts has been deleted. WDYT?

I agree it looks weird. But if you consider testing as a continues process, it also feels weird that nothing happend, you know? Like, imagine you are writing tests and you see an output, that 3 tests passed, 1 test failed - then you delete a file with failed test, but nothing happens? Feels disjointed that it doesn't react.

But it would be an overkill, if I test one specific file, then delete another - then one of a sudden I run all tests? Also feels weird.

@antfu
Copy link
Member

antfu commented Apr 2, 2022

Or maybe instead of rerunning, we could remove the result of that file, and print the report again.

@sheremet-va sheremet-va requested a review from antfu April 3, 2022 06:13
@sheremet-va sheremet-va changed the title feat: rerun all tests, if one of the test files was deleted feat: reprint all tests, if one of the test files was deleted Apr 3, 2022
@antfu antfu enabled auto-merge (squash) April 3, 2022 08:07
@antfu antfu merged commit 2ded624 into vitest-dev:main Apr 3, 2022
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

Successfully merging this pull request may close these issues.

Test status doesn't update if test file is deleted
2 participants