Files
node/test/parallel/test-v8-stop-coverage.js
T
Junsoo Ha f7968e73ee test: use common/child_process spawnSync helpers
Replace manual spawnSync() result assertions
with test/common/child_process helper functions.

Signed-off-by: Junsoo Ha <junsoo2018@naver.com>
PR-URL: https://github.com/nodejs/node/pull/65377
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-08-21 13:40:07 +00:00

34 lines
908 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 { spawnSyncAndExitWithoutError } = require('../common/child_process');
common.skipIfInspectorDisabled();
tmpdir.refresh();
const intervals = 20;
{
const { child } = spawnSyncAndExitWithoutError(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(child.stderr.toString());
const coverageFiles = fs.readdirSync(tmpdir.path);
assert.strictEqual(coverageFiles.length, 0);
}