| 4 | import { PostgreSqlDriver } from '@mikro-orm/postgresql'; |
| 5 | |
| 6 | class CustomConnection extends Connection { |
| 7 | protected client: any; |
| 8 | |
| 9 | override async close(force?: boolean): Promise<void> { |
| 10 | return undefined; |
| 11 | } |
| 12 | |
| 13 | connect(): void { |
| 14 | return undefined; |
| 15 | } |
| 16 | |
| 17 | async execute(query: string, params?: any[], method?: 'all' | 'get' | 'run'): Promise<QueryResult | any | any[]> { |
| 18 | return undefined; |
| 19 | } |
| 20 | |
| 21 | async isConnected(): Promise<boolean> { |
| 22 | return false; |
| 23 | } |
| 24 | |
| 25 | async checkConnection(): Promise<{ ok: true } | { ok: false; reason: string; error?: Error }> { |
| 26 | return { ok: false, reason: 'foo' }; |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | describe('Connection', () => { |
| 31 | test('by default it throws when trying to use transactions', async () => { |
nothing calls this directly
no outgoing calls
no test coverage detected