From 2cbc0e2f8e542eb2197aba1860d6d95ebdf60b26 Mon Sep 17 00:00:00 2001 From: Benny Samir Hierl Date: Fri, 4 Mar 2022 22:04:56 +0100 Subject: [PATCH] reports added to unittest Signed-off-by: Benny Samir Hierl --- .github/workflows/ci.yml | 7 +++++++ .gitignore | 1 + package.json | 4 ++-- vite.config.ts | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3affc6f..b9662d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,13 @@ jobs: run: npm ci - name: Unit tests run: npm run test:unit:ci + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: Vitest Tests + path: reports/unittest.xml + reporter: jest-junit docker: runs-on: ubuntu-latest needs: diff --git a/.gitignore b/.gitignore index 6d406ab..34a0b67 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ dist/ coverage .env data +reports/ diff --git a/package.json b/package.json index 95ebdce..5f8b558 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "build:backend": "prisma generate && tsc -p tsconfig.backend.json --outDir dist", "preview": "vite preview --port 5050", "test:unit": "vitest --environment jsdom", - "test:unit:ci": "vitest --environment jsdom --run", - "coverage": "vitest run --environment jsdom --coverage --reporter=junit", + "test:unit:ci": "vitest --environment jsdom --run --reporter=junit", + "coverage": "vitest run --environment jsdom --coverage", "typecheck": "vue-tsc --noEmit", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "prepare": "husky install" diff --git a/vite.config.ts b/vite.config.ts index af3235b..f8e2cca 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -20,4 +20,7 @@ export default defineConfig({ build: { outDir: 'dist/static', }, + test: { + outputFile: 'reports/unittest.xml', + }, })