[Vuejs]-Vue.js can I import a module in an e2e test ? Syntax error on import

0👍

As @Omran mentioned , I had problem w ES6 transpiring ..

1 – need to insert before the import ( and also write a correct path…)

e2e/test.js

require('babel-core/register')
import { WORKING_TIME } from '../../../config'

2 – e2e test runner.js is setting :

process.env.NODE_ENV = 'testing'

I should add it into .babelrc

.babelrc

{
  "presets": [
    ["env", {
      "modules": false,
      "targets": {
        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
      }
    }],
    "stage-2"
  ],
  "plugins": ["transform-runtime"],
  "env": {
    "test": {
      "presets": ["env", "stage-2"],
      "plugins": ["istanbul"]
    },
    "testing": {
      "presets": ["env", "stage-2"],
      "plugins": ["istanbul"]
    }
  }
}

Leave a comment