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

File tree

7 files changed

+4
-1
lines changed

7 files changed

+4
-1
lines changed

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

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)