Repository navigation
fix: keep watching when the last test file is removed - #6355
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6355 +/- ##
==========================================
+ Coverage 63.38% 63.42% +0.03%
==========================================
Files 64 64
Lines 4971 4979 +8
Branches 1102 1128 +26
==========================================
+ Hits 3151 3158 +7
- Misses 1820 1821 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mark-wiemer
approved these changes
Sep 19, 2026
Member
|
Starting to think we may need to consider this a breaking change, I've reached out to @JoshuaKGoldberg . More details in backing issue. |
Member
|
We agree this is a non-breaking change :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
status: accepting prsOverview
mocha --watchquit as soon as it had no test files left so deleting or renaming your last spec file killed the watcher. Now it warns and runs nothing and keeps waiting then picks the tests back up when a file shows up again.Two separate things were going on here. In serial mode it killed the process outright. With the
--parallelflag the process actually survived and did not get terminated but it printed a raw stack trace and skipped the run because it tried to unload a test file that was no longer on disk. Fixed both since they were hit from the same action.One nice thing about this is that running
--watchin a project with no tests yet no longer exits straight away which fixes the case Josh raised in issue. A normal run without--watchis unchanged and it still shows the same error and exits with code 1.