Skip to content

Commit

Permalink
Removed instrument check before saving sourceMap. Updated the changel…
Browse files Browse the repository at this point in the history
…og with this pull
  • Loading branch information
Aftabnack committed Jan 16, 2018
1 parent 46e5ec5 commit 24d8228
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Fixes

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

Expand Down
4 changes: 3 additions & 1 deletion packages/jest-runtime/src/script_transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ export default class ScriptTransformer {
}

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

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

0 comments on commit 24d8228

Please sign in to comment.