Skip to content

Commit 43a5d1f

Browse files
committed
test_runner: enable coverage on run() with isolation: 'none'
run({ coverage: true, isolation: 'none' }) previously returned an empty file list because V8 precise coverage is only started at bootstrap when NODE_V8_COVERAGE or --experimental-test-coverage is set, neither of which the API path requires. Call the new profiler.startCoverage() binding from setupCoverage() so the parent isolate is instrumented when the run() API is the entry point. Fixes: #60023 Signed-off-by: sangwook <rewq5991@gmail.com>
1 parent 90b8d51 commit 43a5d1f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/internal/test_runner/coverage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ function setupCoverage(options) {
533533
return null;
534534
}
535535

536+
internalBinding('profiler').startCoverage();
537+
536538
// Ensure that NODE_V8_COVERAGE is set so that coverage can propagate to
537539
// child processes.
538540
process.env.NODE_V8_COVERAGE = coverageDirectory;

0 commit comments

Comments
 (0)