From 9260866f471b0717a25fbf878251d0be6fbfc1b9 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 12 May 2026 12:19:01 +0200 Subject: [PATCH] ci(unit-tests): add early grep check for banned vi.mock pdfjs-dist pattern Adds a static grep step that runs after Lint and before the test suite. Fails in ~1 s if any file under frontend/src/ contains the banned vi.mock('pdfjs-dist' pattern, catching the regression before Playwright spins up. Belt-and-suspenders with the ESLint rule (ADR 012). Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0b27866c..aa65e565 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -36,6 +36,14 @@ jobs: run: npm run lint working-directory: frontend + - name: Assert no banned vi.mock patterns + shell: bash + run: | + if grep -rF "vi.mock('pdfjs-dist'" frontend/src/; then + echo "FAIL: banned vi.mock('pdfjs-dist') pattern found — see ADR 012. Use the libLoader prop injection pattern instead." + exit 1 + fi + - name: Run unit and component tests with coverage shell: bash run: |