Skip to content

feat: add --clear-screen option for watch mode - #6133

Merged
mark-wiemer merged 2 commits into
mochajs:mainfrom
mostafaNazari702:feat-clear-screen
Jul 18, 2026
Merged

mark-wiemer merged 2 commits into
mochajs:mainfrom
mostafaNazari702:feat-clear-screen

Conversation

@mostafaNazari702

@mostafaNazari702 mostafaNazari702 commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

Overview

Added a --clear-screen flag that clears the terminal before each run under --watch. I took the name from Josh's suggestion in the issue. It clears before every run,including the first, to match the "min" reporter and "tsc --watch".
It's a no-op without --watch so it stays out of the way of single runs.

bild

@codecov

codecov Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.44%. Comparing base (7ad398e) to head (f87f984).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6133      +/-   ##
==========================================
+ Coverage   82.38%   82.44%   +0.06%     
==========================================
  Files          61       61              
  Lines        4564     4569       +5     
  Branches      958      959       +1     
==========================================
+ Hits         3760     3767       +7     
+ Misses        804      802       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mostafaNazari702

Copy link
Copy Markdown
Contributor Author

Forgot to include:
bild

bild

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changes Jul 4, 2026

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clean! And a great PR description too 🙂. Just a couple of small touchups please.

Comment thread lib/cli/run.cjs Outdated
Comment thread lib/cli/watch-run.cjs Outdated
@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author waiting on response from OP or other posters - more information needed label Jul 4, 2026
@github-actions github-actions Bot removed the status: waiting for author waiting on response from OP or other posters - more information needed label Jul 4, 2026
@mostafaNazari702

mostafaNazari702 commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor Author

@JoshuaKGoldberg I had to use this in another project and actually your point stands. I did a new round of searching and i think you were right, though both standard the one you recommended seems to be the convention. Excuse me for being a smart aleck 😁.

@mark-wiemer
mark-wiemer merged commit 3301ed7 into mochajs:main Jul 18, 2026
229 of 231 checks passed
@mostafaNazari702
mostafaNazari702 deleted the feat-clear-screen branch August 10, 2026 08:45
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.

🚀 Feature: Add a --clearscreen option to go with --watch

3 participants