Vue单元测试实战教程(Mocha/Karma + Vue-Test-Utils + Chai)
安装测试插件
npm install --save-dev @vue/test-utils@1.0.0-beta.12
修改test/unit/specs/HelloWorld.spec.js
// 引入vue的测试工具
import { mount } from "@vue/test-utils"
// 引入需要测试的组件
import HelloWorld from '@/components/HelloWorld'
// 创建测试套件
describe('helloWorld测试套件',...
原创
2020-08-26 16:25:53 ·
2754 阅读 ·
1 评论