From baf9e400e0db68898e85d2296fcc5d11919f7b48 Mon Sep 17 00:00:00 2001 From: Robbert Broersma Date: Tue, 19 Nov 2024 20:21:16 +0100 Subject: [PATCH 1/2] ci: require 100% code coverage --- .../components-react/code-block-react/jest.config.mjs | 8 ++++++++ packages/components-react/code-react/jest.config.mjs | 11 +++++++++++ .../color-sample-react/jest.config.mjs | 11 +++++++++++ .../components-react/data-badge-react/jest.config.mjs | 11 +++++++++++ .../components-react/heading-1-react/jest.config.mjs | 11 +++++++++++ .../components-react/heading-2-react/jest.config.mjs | 11 +++++++++++ .../components-react/heading-3-react/jest.config.mjs | 11 +++++++++++ .../components-react/heading-4-react/jest.config.mjs | 11 +++++++++++ .../components-react/heading-5-react/jest.config.mjs | 11 +++++++++++ .../components-react/heading-6-react/jest.config.mjs | 11 +++++++++++ .../components-react/heading-react/jest.config.mjs | 11 +++++++++++ packages/components-react/link-react/jest.config.mjs | 11 +++++++++++ packages/components-react/mark-react/jest.config.mjs | 11 +++++++++++ .../number-badge-react/jest.config.mjs | 11 +++++++++++ .../components-react/paragraph-react/jest.config.mjs | 11 +++++++++++ .../components-react/skip-link-react/jest.config.mjs | 11 +++++++++++ 16 files changed, 173 insertions(+) diff --git a/packages/components-react/code-block-react/jest.config.mjs b/packages/components-react/code-block-react/jest.config.mjs index ce52c07c..a8c5e33c 100644 --- a/packages/components-react/code-block-react/jest.config.mjs +++ b/packages/components-react/code-block-react/jest.config.mjs @@ -3,5 +3,13 @@ * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/code-react/jest.config.mjs b/packages/components-react/code-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/code-react/jest.config.mjs +++ b/packages/components-react/code-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/color-sample-react/jest.config.mjs b/packages/components-react/color-sample-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/color-sample-react/jest.config.mjs +++ b/packages/components-react/color-sample-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/data-badge-react/jest.config.mjs b/packages/components-react/data-badge-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/data-badge-react/jest.config.mjs +++ b/packages/components-react/data-badge-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/heading-1-react/jest.config.mjs b/packages/components-react/heading-1-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/heading-1-react/jest.config.mjs +++ b/packages/components-react/heading-1-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/heading-2-react/jest.config.mjs b/packages/components-react/heading-2-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/heading-2-react/jest.config.mjs +++ b/packages/components-react/heading-2-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/heading-3-react/jest.config.mjs b/packages/components-react/heading-3-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/heading-3-react/jest.config.mjs +++ b/packages/components-react/heading-3-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/heading-4-react/jest.config.mjs b/packages/components-react/heading-4-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/heading-4-react/jest.config.mjs +++ b/packages/components-react/heading-4-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/heading-5-react/jest.config.mjs b/packages/components-react/heading-5-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/heading-5-react/jest.config.mjs +++ b/packages/components-react/heading-5-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/heading-6-react/jest.config.mjs b/packages/components-react/heading-6-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/heading-6-react/jest.config.mjs +++ b/packages/components-react/heading-6-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/heading-react/jest.config.mjs b/packages/components-react/heading-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/heading-react/jest.config.mjs +++ b/packages/components-react/heading-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/link-react/jest.config.mjs b/packages/components-react/link-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/link-react/jest.config.mjs +++ b/packages/components-react/link-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/mark-react/jest.config.mjs b/packages/components-react/mark-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/mark-react/jest.config.mjs +++ b/packages/components-react/mark-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/number-badge-react/jest.config.mjs b/packages/components-react/number-badge-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/number-badge-react/jest.config.mjs +++ b/packages/components-react/number-badge-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/paragraph-react/jest.config.mjs b/packages/components-react/paragraph-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/paragraph-react/jest.config.mjs +++ b/packages/components-react/paragraph-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; diff --git a/packages/components-react/skip-link-react/jest.config.mjs b/packages/components-react/skip-link-react/jest.config.mjs index ce52c07c..d32f3bb3 100644 --- a/packages/components-react/skip-link-react/jest.config.mjs +++ b/packages/components-react/skip-link-react/jest.config.mjs @@ -1,7 +1,18 @@ +/** + * @type {import('jest').Config} + * */ /** * @type {import('jest').Config} * */ export default { coverageProvider: 'v8', + coverageThreshold: { + global: { + branches: 100, + functions: 100, + lines: 100, + statements: 100, + }, + }, testEnvironment: 'jest-environment-jsdom', }; From 84913b237e6f2cd4c8393108579676e16745119a Mon Sep 17 00:00:00 2001 From: Robbert Broersma Date: Tue, 19 Nov 2024 20:21:49 +0100 Subject: [PATCH 2/2] ci: share code coverage results with codecov.com --- .github/workflows/continuous-deployment.yml | 5 +++++ packages/components-react/code-react/jest.config.mjs | 3 --- packages/components-react/color-sample-react/jest.config.mjs | 3 --- packages/components-react/data-badge-react/jest.config.mjs | 3 --- packages/components-react/heading-1-react/jest.config.mjs | 3 --- packages/components-react/heading-2-react/jest.config.mjs | 3 --- packages/components-react/heading-3-react/jest.config.mjs | 3 --- packages/components-react/heading-4-react/jest.config.mjs | 3 --- packages/components-react/heading-5-react/jest.config.mjs | 3 --- packages/components-react/heading-6-react/jest.config.mjs | 3 --- packages/components-react/heading-react/jest.config.mjs | 3 --- packages/components-react/link-react/jest.config.mjs | 3 --- packages/components-react/mark-react/jest.config.mjs | 3 --- packages/components-react/number-badge-react/jest.config.mjs | 3 --- packages/components-react/paragraph-react/jest.config.mjs | 3 --- packages/components-react/skip-link-react/jest.config.mjs | 3 --- 16 files changed, 5 insertions(+), 45 deletions(-) diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index 0d6ea747..72e33bb4 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -117,6 +117,11 @@ jobs: - name: "Continuous Integration: test" run: pnpm run --if-present test + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + publish-website: runs-on: ubuntu-latest needs: build diff --git a/packages/components-react/code-react/jest.config.mjs b/packages/components-react/code-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/code-react/jest.config.mjs +++ b/packages/components-react/code-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/color-sample-react/jest.config.mjs b/packages/components-react/color-sample-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/color-sample-react/jest.config.mjs +++ b/packages/components-react/color-sample-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/data-badge-react/jest.config.mjs b/packages/components-react/data-badge-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/data-badge-react/jest.config.mjs +++ b/packages/components-react/data-badge-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/heading-1-react/jest.config.mjs b/packages/components-react/heading-1-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/heading-1-react/jest.config.mjs +++ b/packages/components-react/heading-1-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/heading-2-react/jest.config.mjs b/packages/components-react/heading-2-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/heading-2-react/jest.config.mjs +++ b/packages/components-react/heading-2-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/heading-3-react/jest.config.mjs b/packages/components-react/heading-3-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/heading-3-react/jest.config.mjs +++ b/packages/components-react/heading-3-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/heading-4-react/jest.config.mjs b/packages/components-react/heading-4-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/heading-4-react/jest.config.mjs +++ b/packages/components-react/heading-4-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/heading-5-react/jest.config.mjs b/packages/components-react/heading-5-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/heading-5-react/jest.config.mjs +++ b/packages/components-react/heading-5-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/heading-6-react/jest.config.mjs b/packages/components-react/heading-6-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/heading-6-react/jest.config.mjs +++ b/packages/components-react/heading-6-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/heading-react/jest.config.mjs b/packages/components-react/heading-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/heading-react/jest.config.mjs +++ b/packages/components-react/heading-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/link-react/jest.config.mjs b/packages/components-react/link-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/link-react/jest.config.mjs +++ b/packages/components-react/link-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/mark-react/jest.config.mjs b/packages/components-react/mark-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/mark-react/jest.config.mjs +++ b/packages/components-react/mark-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/number-badge-react/jest.config.mjs b/packages/components-react/number-badge-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/number-badge-react/jest.config.mjs +++ b/packages/components-react/number-badge-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/paragraph-react/jest.config.mjs b/packages/components-react/paragraph-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/paragraph-react/jest.config.mjs +++ b/packages/components-react/paragraph-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */ diff --git a/packages/components-react/skip-link-react/jest.config.mjs b/packages/components-react/skip-link-react/jest.config.mjs index d32f3bb3..a8c5e33c 100644 --- a/packages/components-react/skip-link-react/jest.config.mjs +++ b/packages/components-react/skip-link-react/jest.config.mjs @@ -1,6 +1,3 @@ -/** - * @type {import('jest').Config} - * */ /** * @type {import('jest').Config} * */