summaryrefslogtreecommitdiff
path: root/test/parallel/test-coverage-with-inspector-disabled.js
blob: f2ba070859527e7ad1c318f10226673aea371bd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'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
);