Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: consider --enable-source-maps option in coverage report #55146

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/internal/test_runner/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const {
readFileSync,
rmSync,
} = require('fs');
const { getOptionValue } = require('internal/options');
const { setupCoverageHooks } = require('internal/util');
const { tmpdir } = require('os');
const { join, resolve, relative, matchesGlob } = require('path');
Expand Down Expand Up @@ -338,9 +339,10 @@ class TestCoverage {


mapCoverageWithSourceMap(coverage) {
const sourceMapEnabled = getOptionValue('--enable-source-maps');
const { result } = coverage;
const sourceMapCache = coverage['source-map-cache'];
if (!sourceMapCache) {
if (!sourceMapEnabled || !sourceMapCache) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use getOptionValue. Instead, check whether the test runners sourceMaps is true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RedYetiDev , do you have any clue on how I could do that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my previous implementation for more information

return result;
}
const newResult = new SafeMap();
Expand Down
Loading