jeromeky
jeromeky
Sep 14, 2017 · 1 min read

Hey Edd,

Yes I did.

This is how my package.json looks like :

"jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "vue"
    ],
    "moduleNameMapper": {
        "src/components/(.*)$": "<rootDir>/src/components/$1.vue",
        "src/helpers/(.*)$": "<rootDir>/src/helpers/$1.js"
    },
    "transform": {
      "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
      ".*\\.(vue)$": "<rootDir>/node_modules/jest-vue"
    }
  },

Also had to add moduleNameMapper to resolve this kind of import from my components :

import Step2 from '@/components/Step2'

I can create a simple project and try to reproduce this error and submit it in github if that can help.

    jeromeky

    Written by

    jeromeky

    I am passionate by development, always looking to develop my skills further, researching new technologies and reveling in new challenges.