test vue e2e with karma
note: you can also test your project with Vue CLI 3
- webpack4
- vue2
- babel7
- mocha6
- karma4
karma.config.js
01.tell karma which file to test (karma.config.js)
02.tell karma to process test files with karma-webpack and karma-sourcemap-loader (karma.config.js)
03.tell karma to use mocha framework with karma-mocha (karma.config.js)
04.tell karma to use spec reporter likes mocha spec reporter with karma-spec-reporter (karma.config.js)
05.tell karma to use Istanbul with karma-coverage (karma.config.js)
06.tell karma to test in browser chrome with karma-chrome-launcher (karma.config.js)
07.tell karma to use chai with karma-chai (karma.config.js)
note: if use mocha , remember to install mocha lib . if you use chai,remember to install chai lib .
# install dependencies
npm install
#install tes deps (esstional)
#npm run install:tes
#npm run install:tes:e2e
#install dev deps (optional)
#npm run install:dev
#install pro deps (optional)
#npm run install:pro
# run build for dev
npm run dev
# run build for pro
#npm run build
npm run build:pro
#run test
npm run test
#run test for e2e
npm run test:e2e
npm run test:tes:with-ci
For detailed explanation on how he work, consult the docs vuejs.vue-template-compiler.github
For detailed explanation on how he work, consult the docs vuejs.vue-style-loader.github
For detailed explanation on how he work, consult the docs webpack-contrib.css-loader.github
For detailed explanation on how he work, consult the docs zinserjan.mocha-webpack.github
webpack-contrib.karma-webpack.github
For detailed explanation on how he work, consult the docs karma-runner.karma-mocha.github
For detailed explanation on how he work, consult the docs xdissent.karma-chai.github
mlex.karma-spec-reporter.github
For detailed explanation on how he work, consult the docs karma-runner.karma-coverage.github
For detailed explanation on how he work, consult the docs karma-runner.karma-chrome-launcher.github
For detailed explanation on how he work, consult the docs vuejs.vue-test-utils.github
For detailed explanation on how he work, consult the docs vuejs.eslint-plugin-vue.github
yemiancheng ymc-github@gmail.com
Evan You yyx990803@gmail.com
MIT