From e89fb6f99b849200ea8ccb07d4619d8ca41a491c Mon Sep 17 00:00:00 2001 From: Jonas Hungershausen Date: Wed, 27 Nov 2024 18:25:54 +0100 Subject: [PATCH] chore(ci): try out code cov test results reporter --- .github/workflows/ci.yml | 5 +++++ package-lock.json | 2 ++ packages/elements-react/.env.test | 2 ++ packages/elements-react/.gitignore | 1 + packages/elements-react/jest.config.ts | 1 + packages/elements-react/package.json | 1 + 6 files changed, 12 insertions(+) create mode 100644 packages/elements-react/.env.test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e06ec89e..314cf4b20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,3 +51,8 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} + + - uses: codecov/test-results-action@v1 + with: + files: ./packages/elements-react/test-results/junit.xml + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 557f005e2..b61735719 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22639,6 +22639,7 @@ "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-16.0.0.tgz", "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "mkdirp": "^1.0.4", "strip-ansi": "^6.0.1", @@ -33025,6 +33026,7 @@ "@types/lodash.merge": "4.6.9", "esbuild-plugin-svgr": "3.0.0", "eslint-plugin-react": "7.37.1", + "jest-junit": "16.0.0", "postcss": "8.4.47", "tsup": "8.3.0" }, diff --git a/packages/elements-react/.env.test b/packages/elements-react/.env.test new file mode 100644 index 000000000..61fc5997e --- /dev/null +++ b/packages/elements-react/.env.test @@ -0,0 +1,2 @@ +JEST_JUNIT_CLASSNAME="{filepath}" +JEST_JUNIT_OUTPUT_FILE="packages/elements-react/test-results/junit.xml" \ No newline at end of file diff --git a/packages/elements-react/.gitignore b/packages/elements-react/.gitignore index c07f23812..586ad83cb 100644 --- a/packages/elements-react/.gitignore +++ b/packages/elements-react/.gitignore @@ -2,3 +2,4 @@ playwright/.cache/ playwright-report/* .last-run.json api-report/temp +test-results/ \ No newline at end of file diff --git a/packages/elements-react/jest.config.ts b/packages/elements-react/jest.config.ts index bb34ffb9a..5c405b80c 100644 --- a/packages/elements-react/jest.config.ts +++ b/packages/elements-react/jest.config.ts @@ -20,4 +20,5 @@ export default { moduleFileExtensions: ["ts", "tsx", "js", "jsx"], coverageDirectory: "../../coverage/packages/elements-react", coveragePathIgnorePatterns: ["/node_modules/", "/dist/", ".svg"], + reporters: ["default", "jest-junit"], } satisfies Config diff --git a/packages/elements-react/package.json b/packages/elements-react/package.json index 07f1de66e..4ee7108f9 100644 --- a/packages/elements-react/package.json +++ b/packages/elements-react/package.json @@ -56,6 +56,7 @@ "@types/lodash.merge": "4.6.9", "esbuild-plugin-svgr": "3.0.0", "eslint-plugin-react": "7.37.1", + "jest-junit": "16.0.0", "postcss": "8.4.47", "tsup": "8.3.0" },