mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 13:40:37 +00:00

common.skipIfInspectorEnabled() is only used once in all of the tests. The test is more clear (in my opinion, at least) without the abstraction so put the check directly in the test. Additionally, it honestly looks like an error (which is how I noticed it in the first place) and that someone mistyped the far more common skipIfInspectorDisabled(). PR-URL: https://github.com/nodejs/node/pull/29993 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
27 lines
705 B
JavaScript
27 lines
705 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (process.features.inspector) {
|
|
common.skip('V8 inspector is enabled');
|
|
}
|
|
|
|
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
|
|
);
|