mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
This test contains too many independent test cases and as a result, marking it as flaky on all major platforms means actual regressions could be covered up, and it's constantly making the CI orange and requires extra resuming on the flaked platforms which is still not great. Split it into individual files so that the actual flake can be identified out of the monolith. PR-URL: https://github.com/nodejs/node/pull/60653 Refs: https://github.com/nodejs/node/issues/54534 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
27 lines
813 B
JavaScript
27 lines
813 B
JavaScript
// Test run({ watch: true, cwd }) runs with different cwd while in watch mode
|
|
import * as common from '../common/index.mjs';
|
|
import { run } from 'node:test';
|
|
import tmpdir from '../common/tmpdir.js';
|
|
import { refreshForTestRunnerWatch, skipIfNoWatch } from '../common/watch.js';
|
|
|
|
skipIfNoWatch();
|
|
refreshForTestRunnerWatch();
|
|
|
|
const controller = new AbortController();
|
|
const stream = run({
|
|
cwd: tmpdir.path,
|
|
watch: true,
|
|
signal: controller.signal,
|
|
}).on('data', function({ type }) {
|
|
if (type === 'test:watch:drained') {
|
|
stream.removeAllListeners('test:fail');
|
|
stream.removeAllListeners('test:pass');
|
|
controller.abort();
|
|
}
|
|
});
|
|
|
|
stream.on('test:fail', common.mustNotCall());
|
|
stream.on('test:pass', common.mustCall(1));
|
|
// eslint-disable-next-line no-unused-vars
|
|
for await (const _ of stream);
|