嘗試寫一些茉莉花測試我的應用程序做出反應,並收到此錯誤:意外標記導入使用陣營茉莉花巴貝爾的WebPack
import HomePage from '../../src/components/home/HomePage';
^^^^^^SyntaxError: Unexpected token import
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.jasmine.executeSpecsInFolder (C:\Users\JasmineTest\node_modules\jasmine-node\lib\jasmine-node\index.js:160:9)
at Object.<anonymous> (C:\Users\JasmineTest\node_modules\jasmine-node\lib\jasmine-node\cli.js:248:9)
使用反應,巴貝爾裝載機,的WebPack。 只給出錯誤,如果我嘗試導入組件,或者如果我使用必需('組件'),並在組件中使用導入。
我們可以看到你的babelrc?在運行測試時看起來不像babel正在運行。 –
{ 「預設」: 「反應」, 「ES2015」], 「ENV」:{ 「發展」:{ 「預設」: 「反應-hmre」] } } } –