我使用
测试正常运行。但是覆盖范围是错误的。
它没有显示所有线路的覆盖范围。它显示了第一行的覆盖范围,并且在其他任何地方都不会显示覆盖范围。不知道这里是什么问题。
这与Vue 2不使用,而是使用Vue 3的工作。
包裹:
{
“名称”:“ vue_three_without_ts”,
“版本”:“ 0.1.0”,
“私人”:是的,
“脚本”:{
“服务”:“ vue-cli服务服务”,
“构建”:“ vue-cli服务构建”,
“测试:单位”:“ Vue-CLI服务测试:单位”,
“ lint”:“ Vue-Cli-Service lint”
},,
“依赖关系”:{
“ core-js”:“^3.8.3”,
“ vue”:“^3.2.13”
},,
“ devDectiencies”:{
“@babel/core”:“^7.12.16”,
“@babel/eslint-parser”:“^7.12.16”,
“@vue/cli-plugin-babel”:“ 〜5.0.0”,
“@vue/cli-plugin-eslint”:“ 〜5.0.0”,
“@vue/cli-plugin-unit-jest”:“ 〜5.0.0”,
“@vue/cli-service”:“ 〜5.0.0”,
“@vue/test-utils”:“^2.0.0-0”,
“@vue/vue3-jest”:“^27.0.0-alpha.1”,
“ babel-jest”:“^27.0.6”,
“ eslint”:“^7.32.0”,
“ eslint-plugin-vue”:“^8.0.3”,
“开玩笑”:“^27.0.5”
}
}
vue3
软件包:
{
“名称”:“ vue_two_without_ts”,
“版本”:“ 0.1.0”,
“私人”:是的,
“脚本”:{
“服务”:“ vue-cli服务服务”,
“构建”:“ vue-cli服务构建”,
“测试:单位”:“ Vue-CLI服务测试:单位”,
“ lint”:“ Vue-Cli-Service lint”
},,
“依赖关系”:{
“ core-js”:“^3.8.3”,
“ vue”:“^2.6.14”
},,
“ devDectiencies”:{
“@babel/core”:“^7.12.16”,
“@babel/eslint-parser”:“^7.12.16”,
“@vue/cli-plugin-babel”:“ 〜5.0.0”,
“@vue/cli-plugin-eslint”:“ 〜5.0.0”,
“@vue/cli-plugin-unit-jest”:“ 〜5.0.0”,
“@vue/cli-service”:“ 〜5.0.0”,
“@vue/test-utils”:“^1.1.3”,
“@vue/vue2-jest”:“^27.0.0-alpha.2”,
“ babel-jest”:“^27.0.6”,
“ eslint”:“^7.32.0”,
“ eslint-plugin-vue”:“^8.0.3”,
“开玩笑”:“^27.0.5”,
“ vue-template-compiler”:“^2.6.14”
}
}
vue2
I have setup unit testing using installation instructions from https://v1.test-utils.vuejs.org/
Tests are running properly. But the coverage is coming incorrectly.
It's not showing coverage for all the lines. It shows coverage in the first line and doesn't show coverage anywhere else. Don't know what's the issue is here.
This is not working with Vue 2. But with Vue 3 its working.
Package:
{
"name": "vue_three_without_ts",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.8.3",
"vue": "^3.2.13"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-unit-jest": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/test-utils": "^2.0.0-0",
"@vue/vue3-jest": "^27.0.0-alpha.1",
"babel-jest": "^27.0.6",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"jest": "^27.0.5"
}
}
Vue3
package:
{
"name": "vue_two_without_ts",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.8.3",
"vue": "^2.6.14"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-unit-jest": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/test-utils": "^1.1.3",
"@vue/vue2-jest": "^27.0.0-alpha.2",
"babel-jest": "^27.0.6",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"jest": "^27.0.5",
"vue-template-compiler": "^2.6.14"
}
}
Vue2
发布评论