An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
fix: restore v0.5 test setup and update CI for conditional test runs
Yoshiki Miura9b69e646ee9e
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 0c35c4cb..c24434fd 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -36,7 +36,11 @@ jobs:env:DATABASE_URL: postgresql://user:pass@localhost:5432/db+ # Run tests only if test script exists (for v0.5 branch)- name: Run tests- run: bun test+ run: |+ if [ -f "vitest.config.ts" ]; then+ bun run test+ fienv:DATABASE_URL: postgresql://user:pass@localhost:5432/dbdiff --git a/vitest.setup.ts b/vitest.setup.tsindex d4d06fee..2e597295 100644--- a/vitest.setup.ts+++ b/vitest.setup.ts@@ -1,5 +1,13 @@import '@testing-library/jest-dom'+import { vi } from 'vitest'// Provide dummy values for environment variables required during testsprocess.env.DATABASE_URL =process.env.DATABASE_URL ?? 'postgres://user:pass@localhost:5432/testdb'++// Mock Next.js functions+vi.mock('next/cache', () => ({+ revalidateTag: vi.fn(),+ revalidatePath: vi.fn(),+ unstable_cache: vi.fn((fn) => fn)+}))