You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('should import my file',async()=>{constuserFile='./users.json'constusers=awaitimport(userFile)console.log(users)})
run npm run test
What is expected?
test should be green and print something like this { data: [ 'bob', 'max' ] }
What is actually happening?
~/sites/lab/test-dyn-import(master*) » npm run test> test-dyn-import@0.1.0 test /home/maxence/sites/lab/test-dyn-import
> vue-cli-service test
FAIL tests/unit/HelloWorld.spec.js
● Test suite failed to run
/home/maxence/sites/lab/test-dyn-import/tests/unit/HelloWorld.spec.js:35
return import(userFile).then(function (someModule) {
^^^^^^
SyntaxError: Unexpected token import
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:316:17)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.488s
Ran all test suites.
ERROR jest exited with code 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test-dyn-import@0.1.0 test: `vue-cli-service test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test-dyn-import@0.1.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/maxence/.npm/_logs/2018-03-02T17_51_40_312Z-debug.log
I'm trying to switch to the new file architecture for one of my side project (https://github.com/maxpou/gitvub).
I solved this issue with the past architecture by the following babelrc file
Version
3.0.0-beta.2
Reproduction link
maxpou/gitvub#43
Steps to reproduce
vue create test-dyn-import
npm run test
What is expected?
test should be green and print something like this
{ data: [ 'bob', 'max' ] }
What is actually happening?
I'm trying to switch to the new file architecture for one of my side project (https://github.com/maxpou/gitvub).
I solved this issue with the past architecture by the following babelrc file
The text was updated successfully, but these errors were encountered: