Skip to content

test_runner: report changed file on watch restart#64457

Open
bitpshr wants to merge 1 commit into
nodejs:mainfrom
bitpshr:test-runner/watch-restarted-file
Open

test_runner: report changed file on watch restart#64457
bitpshr wants to merge 1 commit into
nodejs:mainfrom
bitpshr:test-runner/watch-restarted-file

Conversation

@bitpshr

@bitpshr bitpshr commented Jul 12, 2026

Copy link
Copy Markdown

This picks up #63786 and adds a file property to the test:watch:restarted reporter event, so custom reporters can show which file triggered the restart.

The watcher already carries that path on its changed event since #63781, so this mostly just forwards it along. I typed it as {string|undefined} to match test:summary's file, and it's undefined when the triggering file can't be determined. Since the event had no data before, this stays backward-compatible.

I kept the change to the event data so the default spec reporter output is unchanged, but I'm happy to surface the file there too if that seems useful.

Fixes: #63786

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

The `test:watch:restarted` reporter event now includes a `file` property
with the path of the file whose change triggered the restart. The
watcher already surfaces this path through the `changed` event since it
started printing the changed file name, so this just forwards it to
consumers of the reporter stream.

Fixes: nodejs#63786
Signed-off-by: Paul Bouchon <mail@bitpshr.net>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jul 12, 2026
@bitpshr bitpshr force-pushed the test-runner/watch-restarted-file branch from 9c65306 to 7871ade Compare July 12, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--test --watch should report the file that triggered the restart

2 participants