super-productivity/packages/super-sync-server/vitest.config.ts
Johannes Millan f0f536671b test(server): fix testing gaps and failing tests
1. Add DELETE /api/sync/data route tests to sync.routes.spec.ts:
   - Test successful deletion returns { success: true }
   - Test 401 without authorization
   - Test uploading new data works after reset

2. Fix passkey.spec.ts failures (4 tests):
   - Add missing passkey.findUnique mock for credential lookup
   - Update test expectations for discoverable credentials
     (no allowCredentials - implementation changed)

3. Fix password-reset-api.spec.ts failures (12 tests):
   - Exclude from vitest - tests routes that don't exist
   - Server uses passkey/magic link auth, not password auth

All 412 tests now pass.
2026-01-05 17:39:17 +01:00

28 lines
1.1 KiB
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
setupFiles: ['./tests/setup.ts'],
// Skip legacy tests that need migration from SQLite to Prisma
// These tests were written for the old SQLite-based implementation
// and need to be updated to work with async Prisma methods
exclude: [
'**/node_modules/**',
'**/dist/**',
// Legacy tests that use synchronous SQLite patterns
// These tests need to be migrated to async Prisma patterns
'tests/sync.routes.spec.ts',
'tests/auth-flows.spec.ts',
'tests/registration-api.spec.ts',
'tests/api.routes.spec.ts',
// Tests internal impl details that no longer match current service
'tests/snapshot-skip-optimization.spec.ts',
'tests/integration/multi-client-sync.integration.spec.ts',
'tests/integration/snapshot-skip-optimization.integration.spec.ts',
// Tests password reset routes that don't exist - server uses passkey/magic link auth
'tests/password-reset-api.spec.ts',
],
},
});