Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/pr_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # required by the coverage report action to comment on the PR
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -82,8 +85,16 @@ jobs:
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium

- name: Run unit tests
run: npm run test:unit
- name: Run unit tests with coverage
run: npm run test:unit:coverage

# Reports overall + diff coverage as a job summary and a sticky PR comment.
# Informational only — coverage is not currently enforced as a merge gate.
- name: Coverage report
if: always() && github.event_name == 'pull_request'
uses: davelosert/vitest-coverage-report-action@c4bbc33a89b7ace0e63d35f1f7d4bcee31155a73 # v2.13.0
with:
file-coverage-mode: changes

e2e-with-garage:
name: E2E Tests with Garage S3
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"lint": "prettier --check --ignore-path .prettierignore . && eslint .",
"lint:fix": "prettier --write --ignore-path .prettierignore . && eslint . --fix",
"test:unit": "vitest run",
"test:unit:coverage": "vitest run --coverage",
"test:e2e": "node --env-file=.env.test node_modules/.bin/vite build && playwright test",
"test:e2e:garage": "./e2e/run-garage-tests.sh",
"test:e2e:ui": "playwright test --ui",
Expand Down
13 changes: 11 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ export default defineConfig({
test: {
coverage: {
provider: 'v8',
reporter: ['json', 'json-summary'],
reportsDirectory: './coverage'
reporter: ['text', 'html', 'json', 'json-summary'],
reportsDirectory: './coverage',
// Without `include`, files that no test ever imports are silently omitted from the
// report instead of showing as 0% — set it so untested modules are actually visible.
include: ['src/**/*.{ts,svelte}'],
exclude: [
'src/**/*.d.ts',
'src/lib/paraglide/**',
'src/lib/editor/generated/**',
'src/lib/server/migrations/**'
]
},
expect: { requireAssertions: true },
projects: [
Expand Down