[Vuejs]-Vue-jest Failed to collect coverage from vue file

4👍

This is self answer. Well it was silly problem.

There are three problem

  1. preset: '@vue/cli-plugin-unit-jest/presets/no-babel' in jest.config.js make transform option useless

    • removed
  2. Jest 24 dosen’t support babel 6.

    • it should be
      babel-jest": "^23.6.0"
  3. transform’s location was wrong

    • it should be like
  transform: {
    "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
    ".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
  }

Now i fixed three problem. and working good.

I leave this answer because I want my shameful behavior to help others.

👤M_YK

Leave a comment