Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable coverage unit tests report #764

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ changes.
- Change regex for parsing urls to match urls without protocol [Issue 655](https://github.com/IntersectMBO/govtool/issues/655)
- Integrate ga displaying metadata validation with the validation service [Issue 712](https://github.com/IntersectMBO/govtool/issues/712)
- Correct text of the governance action type [Issue 651](https://github.com/IntersectMBO/govtool/issues/651)
- Enable coverage tests report

### Added

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

[![npm](https://img.shields.io/npm/v/npm.svg?style=flat-square)](https://www.npmjs.com/package/npm) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

![Statements](https://img.shields.io/badge/statements-29.28%25-red.svg?style=flat) ![Branches](https://img.shields.io/badge/branches-86.39%25-yellow.svg?style=flat) ![Functions](https://img.shields.io/badge/functions-14.28%25-red.svg?style=flat) ![Lines](https://img.shields.io/badge/lines-29.28%25-red.svg?style=flat)

</div>

<hr/>
Expand Down
1 change: 1 addition & 0 deletions govtool/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/.lighthouseci
/yarn-error.log
.env
coverage
63 changes: 63 additions & 0 deletions govtool/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"test": "vitest",
"test:coverage": "vitest --coverage",
"test:make-badges": "npx istanbul-badges-readme --readmeDir='../../'",
"test:verbose": "vitest --reporter=verbose",
"test:ui": "vitest --ui",
"test-storybook": "test-storybook",
"test:storybook": "test-storybook",
"test:watch": "vitest watch",
"tsc": "npx tsc --noEmit --skipLibCheck"
},
Expand Down Expand Up @@ -73,6 +76,7 @@
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@vitejs/plugin-react": "^4.0.0",
"@vitest/coverage-v8": "^1.5.0",
"@vitest/ui": "^1.1.0",
"chromatic": "^11.3.0",
"eslint": "^8.38.0",
Expand Down
15 changes: 14 additions & 1 deletion govtool/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,20 @@ const vitestConfig = defineVitestConfig({
setupFiles: "./src/setupTests.ts",
globals: true,
environment: "jsdom",
reporters: "verbose",
reporters: ["verbose", "junit"],
coverage: {
include: [
"src/components/**/*",
"src/consts/**/*",
"src/context/**/*",
"src/hooks/**/*",
"src/services/**/*",
"src/utils/**/*",
],
provider: "v8",
reporter: ["json-summary"],
enabled: true,
},
},
});

Expand Down
52 changes: 47 additions & 5 deletions govtool/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
resolved "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz"
integrity sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==

"@ampproject/remapping@^2.2.0":
"@ampproject/remapping@^2.2.0", "@ampproject/remapping@^2.2.1":
version "2.3.0"
resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz"
integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==
Expand Down Expand Up @@ -1608,7 +1608,7 @@
resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==

"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25":
"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.23", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25":
version "0.3.25"
resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz"
integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==
Expand Down Expand Up @@ -3516,6 +3516,25 @@
"@types/babel__core" "^7.20.5"
react-refresh "^0.14.0"

"@vitest/coverage-v8@^1.5.0":
version "1.5.0"
resolved "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.5.0.tgz"
integrity sha512-1igVwlcqw1QUMdfcMlzzY4coikSIBN944pkueGi0pawrX5I5Z+9hxdTR+w3Sg6Q3eZhvdMAs8ZaF9JuTG1uYOQ==
dependencies:
"@ampproject/remapping" "^2.2.1"
"@bcoe/v8-coverage" "^0.2.3"
debug "^4.3.4"
istanbul-lib-coverage "^3.2.2"
istanbul-lib-report "^3.0.1"
istanbul-lib-source-maps "^5.0.4"
istanbul-reports "^3.1.6"
magic-string "^0.30.5"
magicast "^0.3.3"
picocolors "^1.0.0"
std-env "^3.5.0"
strip-literal "^2.0.0"
test-exclude "^6.0.0"

"@vitest/[email protected]":
version "1.5.0"
resolved "https://registry.npmjs.org/@vitest/expect/-/expect-1.5.0.tgz"
Expand Down Expand Up @@ -6997,7 +7016,12 @@ isobject@^3.0.1:
resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz"
integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==

istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0:
istanbul-badges-readme@^1.8.5:
version "1.8.5"
resolved "https://registry.npmjs.org/istanbul-badges-readme/-/istanbul-badges-readme-1.8.5.tgz"
integrity sha512-VEh90ofuufPZIbLeDF2g14wpe0sebhirG0xHooYKpNPYOkGXm6y+HJFotQqIzCg0NmbCnlKnOPL1B2oxG7/piA==

istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0, istanbul-lib-coverage@^3.2.2:
version "3.2.2"
resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz"
integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==
Expand Down Expand Up @@ -7075,7 +7099,7 @@ istanbul-lib-processinfo@^2.0.2:
rimraf "^3.0.0"
uuid "^8.3.2"

istanbul-lib-report@^3.0.0:
istanbul-lib-report@^3.0.0, istanbul-lib-report@^3.0.1:
version "3.0.1"
resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz"
integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==
Expand All @@ -7093,7 +7117,16 @@ istanbul-lib-source-maps@^4.0.0:
istanbul-lib-coverage "^3.0.0"
source-map "^0.6.1"

istanbul-reports@^3.0.2, istanbul-reports@^3.1.3:
istanbul-lib-source-maps@^5.0.4:
version "5.0.4"
resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz"
integrity sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==
dependencies:
"@jridgewell/trace-mapping" "^0.3.23"
debug "^4.1.1"
istanbul-lib-coverage "^3.0.0"

istanbul-reports@^3.0.2, istanbul-reports@^3.1.3, istanbul-reports@^3.1.6:
version "3.1.7"
resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz"
integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==
Expand Down Expand Up @@ -7978,6 +8011,15 @@ magic-string@^0.30.0, magic-string@^0.30.5:
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.15"

magicast@^0.3.3:
version "0.3.4"
resolved "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz"
integrity sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==
dependencies:
"@babel/parser" "^7.24.4"
"@babel/types" "^7.24.0"
source-map-js "^1.2.0"

make-dir@^2.0.0, make-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz"
Expand Down
Loading