vuejs/vue-jest

Failed parse using external template

Open

#45 aperta il 17 gen 2018

Vedi su GitHub
 (10 commenti) (2 reazioni) (0 assegnatari)JavaScript (159 fork)github user discovery
help wantedintend to implement

Metriche repository

Star
 (752 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

I used external template like :

<template
  src="vue2-simplert-core/simplert.html">
</template>

Success when building production file using vue-loader@13.7.0. But unit test failed to run using vue-jest@1.4.0

Here some snippet of my Jest configuration :

 "jest": {
    "mapCoverage": true,
    "coverageDirectory": "test/coverage",
    "moduleNameMapper": {
      "^vue$": "vue/dist/vue.common.js"
    },
    "moduleFileExtensions": [
      "js",
      "vue"
    ],
    "transform": {
      "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
      ".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
    }
  }

Error that I got is :

ENOENT: no such file or directory, open '~/project/src/vue2-simplert-core/simplert.html'

if I look into error message, it because pointing to my project root folder instead of node_modules folder.

Is there any missing from my side ?

Thanks for all response 👍

Guida contributor