Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28c57d7

Browse files
Add test-coverage enforcement to the test process (#85)
1 parent 12ccd8f commit 28c57d7

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ yarn-error.log*
2323
*.njsproj
2424
*.sln
2525
*.sw*
26+
27+
# report files
28+
coverage
29+
jest_html_reporters.html

jest.config.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,19 @@ module.exports = {
1313
testMatch: [
1414
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
1515
],
16-
testURL: "http://localhost/"
16+
"reporters": [
17+
"default",
18+
"jest-html-reporters"
19+
],
20+
testURL: "http://localhost/",
21+
"collectCoverage": true,
22+
"collectCoverageFrom": ["src/**/*.{js,vue}", "!**/node_modules/**", "!src/stories/**"],
23+
"coverageThreshold": {
24+
"global": {
25+
"branches": 70,
26+
"functions": 80,
27+
"lines": 85,
28+
"statements": 85
29+
}
30+
}
1731
};

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"build": "vue-cli-service lint --fix; npm run build:styleguide; npm run build:lib",
66
"test": "vue-cli-service test:unit",
7+
"tdd": "yarn run test --watch --coverage=false",
78
"bundlewatch": "bundlewatch --config ./bundlewatch.config.js",
89
"lint": "vue-cli-service lint",
910
"build:lib": "vue-cli-service build --target lib --name Cloudinary src/index.js && npm run bundlewatch",
@@ -20,6 +21,7 @@
2021
"cloudinary-video-player": "^1.1.1",
2122
"core-js": "2.6.9",
2223
"current-script-polyfill": "1.0.0",
24+
"jest-html-reporters": "^1.2.1",
2325
"vue": "2.6.10"
2426
},
2527
"devDependencies": {

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7560,6 +7560,11 @@ jest-haste-map@^23.6.0:
75607560
micromatch "^2.3.11"
75617561
sane "^2.0.0"
75627562

7563+
jest-html-reporters@^1.2.1:
7564+
version "1.2.1"
7565+
resolved "https://registry.yarnpkg.com/jest-html-reporters/-/jest-html-reporters-1.2.1.tgz#74610de7373910e822387bbf7a59eaff65c3ca85"
7566+
integrity sha512-Ea2zxV7Hhg3pE6cZ+70pS5PkiBywKG8pLuyBc9/JgR6ifnKm2U3t6kvAPX9UNID6YwsPBZjD9sANZ0p49rN4pA==
7567+
75637568
jest-jasmine2@^23.6.0:
75647569
version "23.6.0"
75657570
resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz#840e937f848a6c8638df24360ab869cc718592e0"

0 commit comments

Comments
 (0)