mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
3d5357a2f4
This commit updates the test runner tests in order to switch the default reporter from tap to spec. This commit can be backported, while changing the default reporter cannot. Refs: https://github.com/nodejs/node/issues/54540 PR-URL: https://github.com/nodejs/node/pull/54547 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
26 lines
768 B
JavaScript
26 lines
768 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',
|
|
`--experimental-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/);
|
|
}
|