From 0e10a184e3ce8476db759234eb5232ad6f90d137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=BE=D1=80?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2=D1=81=D0=BA=D0=B8=D0=B9?= Date: Thu, 3 Oct 2024 14:06:20 +0300 Subject: [PATCH] add jest report to workfow --- .github/workflows/main.yml | 10 +++++++++- jest.config.js | 12 ++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dedc72d..f2fd8e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: main +name: Main Workflow on: push: branches: @@ -21,3 +21,11 @@ jobs: - name: Run Unit Tests run: npx jest + + - name: Create Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: Jest Tests + path: reports/jest-*.xml + reporter: jest-junit \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index cb329d8..bd6100e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,11 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} **/ module.exports = { - preset: 'ts-jest' -} \ No newline at end of file + testEnvironment: "node", + transform: { + "^.+.tsx?$": ["ts-jest",{}], + }, + reporters: [ + 'default', + ['jest-junit', {outputDirectory: 'reports', outputName: 'jest-junit.xml'}] + ], + }; \ No newline at end of file