test_runner: emit event when file changes in watch mode · nodejs/node@4d64727
@@ -1121,6 +1121,9 @@ const customReporter = new Transform({
11211121case 'test:watch:drained':
11221122callback(null, 'test watch queue drained');
11231123break;
1124+case 'test:watch:restarted':
1125+callback(null, 'test watch restarted due to file change');
1126+break;
11241127case 'test:start':
11251128callback(null, `test ${event.data.name} started`);
11261129break;
@@ -1166,6 +1169,9 @@ const customReporter = new Transform({
11661169case 'test:watch:drained':
11671170callback(null, 'test watch queue drained');
11681171break;
1172+case 'test:watch:restarted':
1173+callback(null, 'test watch restarted due to file change');
1174+break;
11691175case 'test:start':
11701176callback(null, `test ${event.data.name} started`);
11711177break;
@@ -1210,6 +1216,9 @@ export default async function * customReporter(source) {
12101216case 'test:watch:drained':
12111217yield 'test watch queue drained\n';
12121218break;
1219+case 'test:watch:restarted':
1220+yield 'test watch restarted due to file change\n';
1221+break;
12131222case 'test:start':
12141223yield `test ${event.data.name} started\n`;
12151224break;
@@ -1250,6 +1259,9 @@ module.exports = async function * customReporter(source) {
12501259case 'test:watch:drained':
12511260yield 'test watch queue drained\n';
12521261break;
1262+case 'test:watch:restarted':
1263+yield 'test watch restarted due to file change\n';
1264+break;
12531265case 'test:start':
12541266yield `test ${event.data.name} started\n`;
12551267break;
@@ -3175,6 +3187,10 @@ generated for each test file in addition to a final cumulative summary.
3175318731763188Emitted 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