11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciif (process.features.inspector) { 51cb0ef41Sopenharmony_ci common.skip('V8 inspector is enabled'); 61cb0ef41Sopenharmony_ci} 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures'); 91cb0ef41Sopenharmony_ciconst assert = require('assert'); 101cb0ef41Sopenharmony_ciconst { spawnSync } = require('child_process'); 111cb0ef41Sopenharmony_ciconst env = { ...process.env, NODE_V8_COVERAGE: '/foo/bar' }; 121cb0ef41Sopenharmony_ciconst childPath = fixtures.path('v8-coverage/subprocess'); 131cb0ef41Sopenharmony_ciconst { status, stderr } = spawnSync( 141cb0ef41Sopenharmony_ci process.execPath, 151cb0ef41Sopenharmony_ci [childPath], 161cb0ef41Sopenharmony_ci { env } 171cb0ef41Sopenharmony_ci); 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ciconst warningMessage = 'The inspector is disabled, ' + 201cb0ef41Sopenharmony_ci 'coverage could not be collected'; 211cb0ef41Sopenharmony_ci 221cb0ef41Sopenharmony_ciassert.strictEqual(status, 0); 231cb0ef41Sopenharmony_ciassert.strictEqual( 241cb0ef41Sopenharmony_ci stderr.toString().includes(`Warning: ${warningMessage}`), 251cb0ef41Sopenharmony_ci true 261cb0ef41Sopenharmony_ci); 27