test_runner: emit event when file changes in watch mode · nodejs/node@4d64727

@@ -1121,6 +1121,9 @@ const customReporter = new Transform({

11211121

case 'test:watch:drained':

11221122

callback(null, 'test watch queue drained');

11231123

break;

1124+

case 'test:watch:restarted':

1125+

callback(null, 'test watch restarted due to file change');

1126+

break;

11241127

case 'test:start':

11251128

callback(null, `test ${event.data.name} started`);

11261129

break;

@@ -1166,6 +1169,9 @@ const customReporter = new Transform({

11661169

case 'test:watch:drained':

11671170

callback(null, 'test watch queue drained');

11681171

break;

1172+

case 'test:watch:restarted':

1173+

callback(null, 'test watch restarted due to file change');

1174+

break;

11691175

case 'test:start':

11701176

callback(null, `test ${event.data.name} started`);

11711177

break;

@@ -1210,6 +1216,9 @@ export default async function * customReporter(source) {

12101216

case 'test:watch:drained':

12111217

yield 'test watch queue drained\n';

12121218

break;

1219+

case 'test:watch:restarted':

1220+

yield 'test watch restarted due to file change\n';

1221+

break;

12131222

case 'test:start':

12141223

yield `test ${event.data.name} started\n`;

12151224

break;

@@ -1250,6 +1259,9 @@ module.exports = async function * customReporter(source) {

12501259

case 'test:watch:drained':

12511260

yield 'test watch queue drained\n';

12521261

break;

1262+

case 'test:watch:restarted':

1263+

yield 'test watch restarted due to file change\n';

1264+

break;

12531265

case 'test:start':

12541266

yield `test ${event.data.name} started\n`;

12551267

break;

@@ -3175,6 +3187,10 @@ generated for each test file in addition to a final cumulative summary.

3175318731763188

Emitted when no more tests are queued for execution in watch mode.

317731893190+

### Event: `'test:watch:restarted'`

3191+3192+

Emitted when one or more tests are restarted due to a file change in watch mode.

3193+31783194

## Class: `TestContext`

3179319531803196

<!-- YAML