test_runner: emit test:watch:restarted event on watched file changes
The goal of this PR is to add a test:watch:restarted event to signal to the reporter that some tests have restarted while in watch mode.
This will enable a trivial fix for nodejs/node#57206, which I plan to address later.
Review requested:
- [ ] @nodejs/test_runner
Hey @JacopoPatroclo, thanks for the PR. Could you please add tests to cover the new behaviour? Also, could you please update the documentation?
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 90.28%. Comparing base (6cdcaa9) to head (9ef7789).
:warning: Report is 1092 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #57903 +/- ##
==========================================
+ Coverage 90.26% 90.28% +0.01%
==========================================
Files 630 630
Lines 185933 186331 +398
Branches 36447 36508 +61
==========================================
+ Hits 167840 168233 +393
- Misses 10971 10976 +5
Partials 7122 7122
| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/internal/test_runner/runner.js | 92.49% <100.00%> (+3.61%) |
:arrow_up: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
CI: https://ci.nodejs.org/job/node-test-pull-request/66357/
CI: https://ci.nodejs.org/job/node-test-pull-request/66401/
one small nit - the https://github.com/nodejs/node/labels/commit-queue-squash label would squash all your commits and use the first one upon landing - the first commit message in this case is test_runner: added restart log while in watch mode which seems not very accurate, I think since the CI is already green, we can manually land this, wdyt @pmarchini
@jakecastelli thanks for pointing it out!!! there's no rush, I'd say we could just ask @JacopoPatroclo to manually rewrite the history!
Ahh no worries at all! Happy to do another approval / CI once the commit message is fixed 👍
CI: https://ci.nodejs.org/job/node-test-pull-request/66418/
CI: https://ci.nodejs.org/job/node-test-pull-request/66432/
CI: https://ci.nodejs.org/job/node-test-pull-request/66471/
CI: https://ci.nodejs.org/job/node-test-pull-request/66761/
CI: https://ci.nodejs.org/job/node-test-pull-request/66928/
CI: https://ci.nodejs.org/job/node-test-pull-request/67197/
Landed in 95249083ea5e4aaf9d2827af60c2ac52f50ec1a4
This doesn't land cleanly on v22.x-staging so a manual backport will be necessary if this is to be released there.