mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 21:46:48 +00:00

This commit stabilizes test isolation configuration in the test runner. PR-URL: https://github.com/nodejs/node/pull/56298 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
26 lines
755 B
JavaScript
26 lines
755 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const { match, doesNotMatch, strictEqual } = require('node:assert');
|
|
const { spawnSync } = require('node:child_process');
|
|
const fixtures = require('../common/fixtures');
|
|
const fixture = fixtures.path('test-runner/throws_sync_and_async.js');
|
|
|
|
for (const isolation of ['none', 'process']) {
|
|
const args = [
|
|
'--test',
|
|
'--test-reporter=spec',
|
|
'--test-force-exit',
|
|
`--test-isolation=${isolation}`,
|
|
fixture,
|
|
];
|
|
const r = spawnSync(process.execPath, args);
|
|
|
|
strictEqual(r.status, 1);
|
|
strictEqual(r.signal, null);
|
|
strictEqual(r.stderr.toString(), '');
|
|
|
|
const stdout = r.stdout.toString();
|
|
match(stdout, /Error: fails/);
|
|
doesNotMatch(stdout, /this should not have a chance to be thrown/);
|
|
}
|