diff --git a/lib/process.js b/lib/process.js index ae8c16dc..fa991c48 100644 --- a/lib/process.js +++ b/lib/process.js @@ -13,7 +13,7 @@ const join = path.join const logger = require('./logger') const splitRE = /\r?\n/g -function processScript (scriptPart, vueJestConfig) { +function processScript (scriptPart, vueJestConfig, babelInlineConfig) { if (!scriptPart) { return { code: '' } } @@ -26,10 +26,10 @@ function processScript (scriptPart, vueJestConfig) { return compileCoffeeScript(scriptPart.content, vueJestConfig) } - return compileBabel(scriptPart.content, undefined, undefined, vueJestConfig) + return compileBabel(scriptPart.content, undefined, babelInlineConfig, vueJestConfig) } -module.exports = function (src, filePath, jestConfig) { +module.exports = function (src, filePath, jestConfig, _, babelInlineConfig) { const vueJestConfig = getVueJestConfig(jestConfig) var parts = vueCompiler.parseComponent(src, { pad: true }) @@ -38,7 +38,7 @@ module.exports = function (src, filePath, jestConfig) { parts.script.content = fs.readFileSync(join(filePath, '..', parts.script.src), 'utf8') } - const result = processScript(parts.script, vueJestConfig) + const result = processScript(parts.script, vueJestConfig, babelInlineConfig) const script = result.code const inputMap = result.sourceMap