Skip to content

Commit 24d8228

Browse files
committed
Removed instrument check before saving sourceMap. Updated the changelog with this pull
1 parent 46e5ec5 commit 24d8228

7 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### Fixes
44

5+
* `[jest-runtime]` Removed check for `mapCoverage` boolean before attempting to read inlineSourceMaps. [#5177](https://github.com/facebook/jest/pull/5177)
56
* `[jest-cli]` Fix `EISDIR` when a directory is passed as an argument to `jest`.
67
([#5317](https://github.com/facebook/jest/pull/5317))
78

integration_tests/__tests__/__snapshots__/coverage_remapping_inline_sourcemap.test.js.snap renamed to integration-tests/__tests__/__snapshots__/coverage_remapping_inline_sourcemap.test.js.snap

File renamed without changes.

integration_tests/__tests__/coverage_remapping_inline_sourcemap.test.js renamed to integration-tests/__tests__/coverage_remapping_inline_sourcemap.test.js

File renamed without changes.

integration_tests/coverage-remapping-inline-sourcemap/__tests__/covered-test.js renamed to integration-tests/coverage-remapping-inline-sourcemap/__tests__/covered-test.js

File renamed without changes.

integration_tests/coverage-remapping-inline-sourcemap/covered.js renamed to integration-tests/coverage-remapping-inline-sourcemap/covered.js

File renamed without changes.

integration_tests/coverage-remapping-inline-sourcemap/package.json renamed to integration-tests/coverage-remapping-inline-sourcemap/package.json

File renamed without changes.

packages/jest-runtime/src/script_transformer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ export default class ScriptTransformer {
243243
}
244244

245245
if (!transformed.map) {
246+
//Could be a potential freeze here.
247+
//See: https://github.com/facebook/jest/pull/5177#discussion_r158883570
246248
const inlineSourceMap = convertSourceMap.fromSource(transformed.code);
247249
if (inlineSourceMap) {
248250
transformed.map = inlineSourceMap.toJSON();
@@ -259,7 +261,7 @@ export default class ScriptTransformer {
259261
code = transformed.code;
260262
}
261263

262-
if (instrument && transformed.map) {
264+
if (transformed.map) {
263265
const sourceMapContent =
264266
typeof transformed.map === 'string'
265267
? transformed.map

0 commit comments

Comments
 (0)