Add scripts for E2E and unit test coverage integration

- Added `merge-coverage.ts` to combine Jest and Playwright coverage into a unified report with comprehensive statistics and thresholds.
- Included `convert-v8-to-istanbul.ts` for transforming Playwright V8 coverage into Istanbul format, enabling seamless merging.
- Introduced E2E coverage helpers for Playwright tests (`startCoverage`, `stopAndSaveCoverage`, `withCoverage`) to collect and process both V8 and Istanbul coverage.
- Configured `.nycrc.json` with coverage thresholds and reporting formats for improved visibility and enforcement.
This commit is contained in:
2025-11-09 00:31:36 +01:00
parent d5eb855ae1
commit 6824fd7c33
4 changed files with 733 additions and 0 deletions

34
frontend/.nycrc.json Normal file
View File

@@ -0,0 +1,34 @@
{
"all": true,
"include": [
"src/**/*.{js,jsx,ts,tsx}"
],
"exclude": [
"src/**/*.d.ts",
"src/**/*.test.{js,jsx,ts,tsx}",
"src/**/__tests__/**",
"src/**/*.stories.{js,jsx,ts,tsx}",
"src/lib/api/generated/**",
"src/**/*.old.{js,jsx,ts,tsx}",
"src/components/ui/**",
"src/app/dev/**",
"src/**/index.{js,jsx,ts,tsx}",
"src/lib/utils/cn.ts",
"src/middleware.ts"
],
"reporter": [
"text",
"text-summary",
"html",
"json",
"lcov"
],
"report-dir": "./coverage-combined",
"temp-dir": "./.nyc_output",
"sourceMap": true,
"instrument": true,
"branches": 85,
"functions": 85,
"lines": 90,
"statements": 90
}