Skip to content

Commit

Permalink
Removing the mapCoverage condition on reading inlineSourceMaps. Undoi…
Browse files Browse the repository at this point in the history
…ng fixes done in #5117
  • Loading branch information
Aftab.Khan authored and Aftab.Khan committed Dec 25, 2017
1 parent 4f8f6fb commit a821f90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ describe('ScriptTransformer', () => {
);
});

it.skip('writes source maps if given by the transformer', () => {
it('writes source maps if given by the transformer', () => {
config = Object.assign(config, {
transform: [['^.+\\.js$', 'preprocessor-with-sourcemaps']],
});
Expand Down
12 changes: 5 additions & 7 deletions packages/jest-runtime/src/script_transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,10 @@ export default class ScriptTransformer {
}
}

if (mapCoverage) {
if (!transformed.map) {
const inlineSourceMap = convertSourceMap.fromSource(transformed.code);
if (inlineSourceMap) {
transformed.map = inlineSourceMap.toJSON();
}
if (!transformed.map) {
const inlineSourceMap = convertSourceMap.fromSource(transformed.code);
if (inlineSourceMap) {
transformed.map = inlineSourceMap.toJSON();
}
}

Expand All @@ -261,7 +259,7 @@ export default class ScriptTransformer {
code = transformed.code;
}

if (instrument && mapCoverage && transformed.map) {
if (instrument && transformed.map) {
const sourceMapContent =
typeof transformed.map === 'string'
? transformed.map
Expand Down

0 comments on commit a821f90

Please sign in to comment.