node/test/parallel/test-runner-force-exit-failure.js
Colin Ihrig 219b900384
test_runner,cli: mark test isolation as stable
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>
2024-12-20 02:10:26 +00:00

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/);
}