Closed
Description
Version
3.0.0-rc.10
Node and OS info
Node 10.7.0 / npm 6.3.0-next.0 / Windows 10
Steps to reproduce
- Create new project with only Jest plugin selected
- Run
npm run test:unit
What is expected?
PASS tests/unit/HelloWorld.spec.js
HelloWorld.vue
√ renders props.msg when passed (22ms)
What is actually happening?
FAIL tests/unit/HelloWorld.spec.js
● Test suite failed to run
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Details:
C:\node_workspace\test\tests\unit\HelloWorld.spec.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import { shallowMount } from '@vue/test-utils';
^
SyntaxError: Unexpected token {
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17)
It works as expected if I install both Babel and Jest.