问题描述
我正在开发一个带有一些 vue 组件的 laravel 包,我可以正确运行测试,但覆盖率返回“0”文件,有什么帮助吗?
目录:
资源
- 资产
-
- vue
-
-
- 组件
-
-
-
-
- 基础
-
-
-
-
-
-
- BaseElement.vue
-
-
-
-
-
-
-
- FieldWrapper.vue
-
-
-
- 测试
-
- Js
-
-
- setup.js
-
-
-
- BaseElement.spec.js
-
-
-
- FieldWrapper.spec.js 包.json .nycrc .babelrc Webpack.mix.js
-
在 package.json 中:
"test-vue": "cross-env NODE_ENV=testing mochapack --webpack-config=node_modules/laravel-mix/setup/webpack.config.js --require tests/Js/setup.js tests/Js/\\*\\*/\\*.spec.js","cover": "cross-env NODE_ENV=testing nyc --reporter=lcov --reporter=text npm run test-vue"
.nycrc
{
"include": [
"resources/assets/vue/components/**/**"
],"extension": [
".vue",".ts"
],"exclude": [
"**/*.spec.js"
],"reporter": [
"text-summary","lcov"
]
}
.babelrc
{
"env": {
"testing": {
"plugins": ["istanbul"]
}
}
}
运行:npm run test-vue 一切正常,但是运行 npm run cover,我得到一个空报告:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)