1fafad4e69
Tests / test (push) Successful in 24s
lib/supabase.ts calls createClient at module load, and Supabase's URL validator throws when VITE_SUPABASE_URL is undefined — which it is on the Gitea runner. AccountDetail and Transactions tests transitively import TransactionForm → lib/supabase and trip on it; tests that mock lib/supabase directly slip past. Set explicit placeholder values for the Vitest step so the import succeeds; real auth calls are stubbed inside the tests, so the placeholders are never sent over the wire. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Generate Prisma client
|
|
run: pnpm --filter tehriehlbudget-backend exec prisma generate
|
|
|
|
- name: Backend tests (Jest)
|
|
run: pnpm test:backend
|
|
|
|
- name: Frontend tests (Vitest)
|
|
# Supabase's createClient validates the URL at module load, so the
|
|
# frontend tests need *some* value to import lib/supabase without
|
|
# throwing. Real auth calls are stubbed in the tests, so these are
|
|
# purely structural placeholders — never used over the wire.
|
|
env:
|
|
VITE_SUPABASE_URL: http://localhost:54321
|
|
VITE_SUPABASE_ANON_KEY: placeholder-anon-key-for-tests-only
|
|
run: pnpm test:frontend
|