mirror of
https://github.com/nodejs/node.git
synced 2025-05-12 00:04:15 +00:00

This commit updates the test runner to allow a forced exit once all known tests have finished running. Fixes: https://github.com/nodejs/node/issues/49925 PR-URL: https://github.com/nodejs/node/pull/52038 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
16 lines
590 B
JavaScript
16 lines
590 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');
|
|
const r = spawnSync(process.execPath, ['--test', '--test-force-exit', fixture]);
|
|
|
|
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/);
|