mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
PR-URL: https://github.com/nodejs/node/pull/46881 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
29 lines
950 B
JavaScript
29 lines
950 B
JavaScript
'use strict';
|
|
const {
|
|
prepareMainThreadExecution,
|
|
markBootstrapComplete,
|
|
} = require('internal/process/pre_execution');
|
|
const { getOptionValue } = require('internal/options');
|
|
const { isUsingInspector } = require('internal/util/inspector');
|
|
const { run } = require('internal/test_runner/runner');
|
|
const { setupTestReporters } = require('internal/test_runner/utils');
|
|
const { exitCodes: { kGenericUserError } } = internalBinding('errors');
|
|
|
|
prepareMainThreadExecution(false);
|
|
markBootstrapComplete();
|
|
|
|
let concurrency = true;
|
|
let inspectPort;
|
|
|
|
if (isUsingInspector()) {
|
|
process.emitWarning('Using the inspector with --test forces running at a concurrency of 1. ' +
|
|
'Use the inspectPort option to run with concurrency');
|
|
concurrency = 1;
|
|
inspectPort = process.debugPort;
|
|
}
|
|
|
|
run({ concurrency, inspectPort, watch: getOptionValue('--watch'), setup: setupTestReporters })
|
|
.once('test:fail', () => {
|
|
process.exitCode = kGenericUserError;
|
|
});
|