e2ed
Version:
E2E testing framework over Playwright
21 lines (20 loc) • 906 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTestsSubprocessForkOptions = void 0;
const internal_1 = require("../../constants/internal");
const asserts_1 = require("../asserts");
/**
* Get fork options for tests subprocess.
* @internal
*/
const getTestsSubprocessForkOptions = () => {
if (internal_1.DEBUG_PORT === undefined) {
return undefined;
}
const execArgvWithoutInspect = process.execArgv.filter((arg) => !arg.startsWith('--inspect'));
const port = internal_1.DEBUG_PORT + 1;
// eslint-disable-next-line @typescript-eslint/naming-convention
(0, asserts_1.assertNumberIsPositiveInteger)(port, 'port is positive integer', { DEBUG_PORT: internal_1.DEBUG_PORT });
return { execArgv: [...execArgvWithoutInspect, `--inspect-brk=0.0.0.0:${port}`] };
};
exports.getTestsSubprocessForkOptions = getTestsSubprocessForkOptions;