Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: [SIG-583]: jest coverage setup #4910

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
30 changes: 30 additions & 0 deletions .github/workflows/jest-coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy coverage report to Pages

on:
push:
branches:
- SIG-583

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: cd frontend && npm install -g yarn && yarn
- run: yarn
- run: |
cd frontend
npm run i18n:generate-hash
npm run test --silent || true
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "./frontend/coverage"
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion frontend/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import type { Config } from '@jest/types';
const config: Config.InitialOptions = {
clearMocks: true,
coverageDirectory: 'coverage',
coverageReporters: ['text', 'cobertura', 'html', 'json-summary'],
coverageReporters: ['text', 'cobertura', 'html', 'json-summary', 'lcov'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
modulePathIgnorePatterns: ['dist'],
moduleNameMapper: {
'\\.(css|less|scss)$': '<rootDir>/__mocks__/cssMock.ts',
Expand Down