Skip to content

Commit 364d956

Browse files
committed
Removing the mapCoverage condition on reading inlineSourceMaps. Undoing fixes done in #5117
1 parent 4f8f6fb commit 364d956

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/jest-runtime/src/__tests__/script_transformer.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ describe('ScriptTransformer', () => {
357357
);
358358
});
359359

360-
it.skip('writes source maps if given by the transformer', () => {
360+
it('writes source maps if given by the transformer', () => {
361361
config = Object.assign(config, {
362362
transform: [['^.+\\.js$', 'preprocessor-with-sourcemaps']],
363363
});

packages/jest-runtime/src/script_transformer.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,10 @@ export default class ScriptTransformer {
242242
}
243243
}
244244

245-
if (mapCoverage) {
246-
if (!transformed.map) {
247-
const inlineSourceMap = convertSourceMap.fromSource(transformed.code);
248-
if (inlineSourceMap) {
249-
transformed.map = inlineSourceMap.toJSON();
250-
}
245+
if (!transformed.map) {
246+
const inlineSourceMap = convertSourceMap.fromSource(transformed.code);
247+
if (inlineSourceMap) {
248+
transformed.map = inlineSourceMap.toJSON();
251249
}
252250
}
253251

@@ -261,7 +259,7 @@ export default class ScriptTransformer {
261259
code = transformed.code;
262260
}
263261

264-
if (instrument && mapCoverage && transformed.map) {
262+
if (instrument && transformed.map) {
265263
const sourceMapContent =
266264
typeof transformed.map === 'string'
267265
? transformed.map

0 commit comments

Comments
 (0)