WIP - getting jest coverage to work
2 files added
8 files modified
| | |
| | | *.ntvs* |
| | | *.njsproj |
| | | *.sln |
| | | test-report.xml |
New file |
| | |
| | | module.exports = { |
| | | moduleFileExtensions: [ |
| | | "js", |
| | | "jsx", |
| | | "json", |
| | | "vue" |
| | | ], |
| | | transform: { |
| | | "^.+\\.vue$": "vue-jest", |
| | | "^.+\\.jsx?$": "babel-jest" |
| | | }, |
| | | moduleNameMapper: { |
| | | "^@/(.*)$": "<rootDir>/src/$1" |
| | | }, |
| | | snapshotSerializers: ["jest-serializer-vue"], |
| | | collectCoverage: true, |
| | | collectCoverageFrom: [ |
| | | "src/**/*.{js,vue}", |
| | | "!src/**/*.test.{js,jsx}", |
| | | "!<rootDir>/node_modules/" |
| | | ], |
| | | testResultsProcessor: './node_modules/jest-junit-reporter', |
| | | coverageDirectory: './reports/coverage', |
| | | coverageReporters: [ |
| | | "text", |
| | | "html", |
| | | "clover" |
| | | ] |
| | | } |
| | |
| | | { |
| | | "name": "cli-test", |
| | | "name": "cli-test2", |
| | | "version": "0.1.0", |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "./node_modules/.bin/vue-cli-service serve --open", |
| | | "build": "./node_modules/.bin/vue-cli-service build", |
| | | "test": "./node_modules/.bin/vue-cli-service test", |
| | | "e2e": "./node_modules/.bin/vue-cli-service e2e", |
| | | "e2e-ci": "./node_modules/.bin/vue-cli-service e2e --env jenkins --url http://localhost:8080", |
| | | "lint": "./node_modules/.bin/vue-cli-service lint", |
| | | "e2e-setup": "./node_modules/.bin/selenium-standalone install", |
| | | "e2e-ci-old": "npm run e2e-setup && ./node_modules/.bin/nightwatch --config nightwatch.config.js --env jenkins" |
| | | "serve": "vue-cli-service serve --open", |
| | | "build": "vue-cli-service build", |
| | | "test": "vue-cli-service test", |
| | | "e2e": "vue-cli-service e2e", |
| | | "lint": "vue-cli-service lint" |
| | | }, |
| | | "dependencies": { |
| | | "register-service-worker": "^1.0.0", |
| | |
| | | "@vue/cli-plugin-e2e-nightwatch": "^3.0.0-beta.6", |
| | | "@vue/cli-plugin-eslint": "^3.0.0-beta.6", |
| | | "@vue/cli-plugin-pwa": "^3.0.0-beta.6", |
| | | "@vue/cli-plugin-unit-mocha": "^3.0.0-beta.6", |
| | | "@vue/cli-plugin-unit-jest": "^3.0.0-beta.6", |
| | | "@vue/cli-service": "^3.0.0-beta.6", |
| | | "@vue/eslint-config-prettier": "^3.0.0-beta.6", |
| | | "@vue/test-utils": "^1.0.0-beta.10", |
| | | "chai": "^4.1.2", |
| | | "babel-core": "^7.0.0-0", |
| | | "babel-jest": "^22.0.4", |
| | | "jest-junit-reporter": "^1.1.0", |
| | | "node-sass": "^4.7.2", |
| | | "sass-loader": "^6.0.6", |
| | | "vue-template-compiler": "^2.5.13" |
New file |
| | |
| | | { |
| | | "name": "cli-test", |
| | | "version": "0.1.0", |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "./node_modules/.bin/vue-cli-service serve --open", |
| | | "build": "./node_modules/.bin/vue-cli-service build", |
| | | "test": "./node_modules/.bin/vue-cli-service test", |
| | | "e2e": "./node_modules/.bin/vue-cli-service e2e", |
| | | "e2e-ci": "./node_modules/.bin/vue-cli-service e2e --env jenkins --url http://localhost:8080", |
| | | "lint": "./node_modules/.bin/vue-cli-service lint", |
| | | "e2e-setup": "./node_modules/.bin/selenium-standalone install", |
| | | "e2e-ci-old": "npm run e2e-setup && ./node_modules/.bin/nightwatch --config nightwatch.config.js --env jenkins" |
| | | }, |
| | | "dependencies": { |
| | | "register-service-worker": "^1.0.0", |
| | | "vue": "^2.5.13", |
| | | "vue-router": "^3.0.1", |
| | | "vuex": "^3.0.1" |
| | | }, |
| | | "devDependencies": { |
| | | "@vue/cli-plugin-babel": "^3.0.0-beta.6", |
| | | "@vue/cli-plugin-e2e-nightwatch": "^3.0.0-beta.6", |
| | | "@vue/cli-plugin-eslint": "^3.0.0-beta.6", |
| | | "@vue/cli-plugin-pwa": "^3.0.0-beta.6", |
| | | "@vue/cli-plugin-unit-jest": "^3.0.0-beta.6", |
| | | "@vue/cli-service": "^3.0.0-beta.6", |
| | | "@vue/eslint-config-prettier": "^3.0.0-beta.6", |
| | | "@vue/test-utils": "^1.0.0-beta.10", |
| | | "babel-core": "^7.0.0-0", |
| | | "babel-jest": "^22.0.4", |
| | | "node-sass": "^4.7.2", |
| | | "sass-loader": "^6.0.6", |
| | | "vue-template-compiler": "^2.5.13" |
| | | }, |
| | | "browserslist": [ |
| | | "> 1%", |
| | | "last 2 versions", |
| | | "not ie <= 8" |
| | | ] |
| | | } |
| | |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
| | | <link rel="shortcut icon" href="<%= webpackConfig.output.publicPath %>favicon.ico"> |
| | | <title>cli-test</title> |
| | | <title>cli-test2</title> |
| | | </head> |
| | | <body> |
| | | <noscript> |
| | | <strong>We're sorry but cli-test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
| | | <strong>We're sorry but cli-test2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
| | | </noscript> |
| | | <div id="app"></div> |
| | | <!-- built files will be auto injected --> |
| | |
| | | { |
| | | "name": "cli-test", |
| | | "short_name": "cli-test", |
| | | "name": "cli-test2", |
| | | "short_name": "cli-test2", |
| | | "icons": [ |
| | | { |
| | | "src": "/img/icons/android-chrome-192x192.png", |
| | |
| | | <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank">babel</a></li> |
| | | <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa" target="_blank">pwa</a></li> |
| | | <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank">eslint</a></li> |
| | | <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-mocha" target="_blank">unit-mocha</a></li> |
| | | <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-jest" target="_blank">unit-jest</a></li> |
| | | <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-nightwatch" target="_blank">e2e-nightwatch</a></li> |
| | | </ul> |
| | | <h3>Essential Links</h3> |
| | |
| | | { |
| | | "env": { |
| | | "mocha": true |
| | | "jest": true |
| | | }, |
| | | "rules": { |
| | | "import/no-extraneous-dependencies": "off" |
| | |
| | | import { expect } from "chai"; |
| | | import { shallow } from "@vue/test-utils"; |
| | | import HelloWorld from "@/components/HelloWorld.vue"; |
| | | |
| | |
| | | const wrapper = shallow(HelloWorld, { |
| | | propsData: { msg } |
| | | }); |
| | | expect(wrapper.text()).to.include(msg); |
| | | expect(wrapper.text()).toMatch(msg); |
| | | }); |
| | | }); |