mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 13:47:16 +00:00

Add exception handling for the case when profile is not bootstrapped when coverage is enabled. Fixes: https://github.com/nodejs/node/issues/29542 PR-URL: https://github.com/nodejs/node/pull/29552 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
25 lines
660 B
JavaScript
25 lines
660 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfInspectorEnabled();
|
|
|
|
const fixtures = require('../common/fixtures');
|
|
const assert = require('assert');
|
|
const { spawnSync } = require('child_process');
|
|
const env = { ...process.env, NODE_V8_COVERAGE: '/foo/bar' };
|
|
const childPath = fixtures.path('v8-coverage/subprocess');
|
|
const { status, stderr } = spawnSync(
|
|
process.execPath,
|
|
[childPath],
|
|
{ env }
|
|
);
|
|
|
|
const warningMessage = 'The inspector is disabled, ' +
|
|
'coverage could not be collected';
|
|
|
|
assert.strictEqual(status, 0);
|
|
assert.strictEqual(
|
|
stderr.toString().includes(`Warning: ${warningMessage}`),
|
|
true
|
|
);
|