fix: Einzelner shared Pool, finally-Block verschluckt nicht Original-Fehler, Pool-Error-Handler

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-17 08:30:57 +00:00
parent cdfdd025d2
commit c01befa477
3 changed files with 16 additions and 9 deletions

View File

@@ -1,15 +1,15 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
// Pool mocken — gibt einen fake PoolClient zurück
// Pool aus client.ts mocken — gibt einen fake PoolClient zurück
const mockClient = vi.hoisted(() => ({
query: vi.fn(),
release: vi.fn(),
}))
vi.mock('pg', () => ({
Pool: vi.fn().mockImplementation(() => ({
vi.mock('./client', () => ({
pool: {
connect: vi.fn().mockResolvedValue(mockClient),
})),
},
}))
import { withTenant } from './tenant'