Skip to content

Commit e2c7a56

Browse files
authored
Issue #417: Should not return empty string so that it is compatible with babel (#428)
1 parent 89586a0 commit e2c7a56

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/vue2-jest/lib/transformers/typescript.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ module.exports = scriptLang => ({
2121

2222
res.outputText = stripInlineSourceMap(res.outputText)
2323

24-
const inputSourceMap =
25-
res.sourceMapText !== undefined ? JSON.parse(res.sourceMapText) : ''
24+
const inputSourceMap = res.sourceMapText && JSON.parse(res.sourceMapText)
2625

2726
const customTransformer =
2827
getCustomTransformer(vueJestConfig['transform'], 'js') || {}

packages/vue3-jest/lib/transformers/typescript.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ module.exports = {
2121

2222
res.outputText = stripInlineSourceMap(res.outputText)
2323

24-
const inputSourceMap =
25-
res.sourceMapText !== undefined ? JSON.parse(res.sourceMapText) : ''
24+
const inputSourceMap = res.sourceMapText && JSON.parse(res.sourceMapText)
2625

2726
const customTransformer =
2827
getCustomTransformer(vueJestConfig['transform'], 'js') || {}

0 commit comments

Comments
 (0)