diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23c8f34..6a0b0b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,12 +25,20 @@ jobs: - name: Install UI dependencies working-directory: ./ui - run: npm ci + run: | + npm ci + npm install --save-dev @vitest/coverage-v8 - - name: Run UI tests + - name: Run tests with coverage working-directory: ./ui - run: npm test + run: npm run test:coverage + - name: Archive code coverage results + uses: actions/upload-artifact@v3 + with: + name: code-coverage-report + path: ui/coverage/ + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/ui/package-lock.json b/ui/package-lock.json index 22b327d..899ee9f 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -46,7 +46,7 @@ "sass": "^1.69.5", "typescript": "^5.3.3", "vite": "^5.0.8", - "vitest": "^1.2.1" + "vitest": "^2.1.1" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/ui/package.json b/ui/package.json index 52f21dc..91a18c8 100644 --- a/ui/package.json +++ b/ui/package.json @@ -8,7 +8,8 @@ "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", - "test": "vitest" + "test": "vitest", + "test:coverage": "vitest run --coverage" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.5.1", @@ -49,6 +50,6 @@ "sass": "^1.69.5", "typescript": "^5.3.3", "vite": "^5.0.8", - "vitest": "^1.2.1" + "vitest": "^2.1.1" } }