node/test/parallel/test-v8-stop-coverage.js
Dario Piotrowicz 431c04d0bd
test: use common.skipIfInspectorDisabled() to skip tests
some test files manually check for `!process.features.inspector`
to see if the tests should be skipped, the changes here update
those checks to instead use the more appropriate
`common.skipIfInspectorDisabled()`

PR-URL: https://github.com/nodejs/node/pull/58675
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2025-06-13 12:10:51 +00:00

34 lines
898 B
JavaScript

'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');
const tmpdir = require('../common/tmpdir');
const assert = require('assert');
const fs = require('fs');
const { spawnSync } = require('child_process');
common.skipIfInspectorDisabled();
tmpdir.refresh();
const intervals = 20;
{
const output = spawnSync(process.execPath, [
'-r',
fixtures.path('v8-coverage', 'stop-coverage'),
'-r',
fixtures.path('v8-coverage', 'take-coverage'),
fixtures.path('v8-coverage', 'interval'),
], {
env: {
...process.env,
NODE_V8_COVERAGE: tmpdir.path,
NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER',
TEST_INTERVALS: intervals
},
});
console.log(output.stderr.toString());
assert.strictEqual(output.status, 0);
const coverageFiles = fs.readdirSync(tmpdir.path);
assert.strictEqual(coverageFiles.length, 0);
}