• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4if (process.features.inspector) {
5  common.skip('V8 inspector is enabled');
6}
7
8const fixtures = require('../common/fixtures');
9const assert = require('assert');
10const { spawnSync } = require('child_process');
11const env = { ...process.env, NODE_V8_COVERAGE: '/foo/bar' };
12const childPath = fixtures.path('v8-coverage/subprocess');
13const { status, stderr } = spawnSync(
14  process.execPath,
15  [childPath],
16  { env }
17);
18
19const warningMessage = 'The inspector is disabled, ' +
20                        'coverage could not be collected';
21
22assert.strictEqual(status, 0);
23assert.strictEqual(
24  stderr.toString().includes(`Warning: ${warningMessage}`),
25  true
26);
27