|
1 | 1 | import { describe, it, expect, vi } from 'vitest'; |
2 | | -import { AbstractPowerSyncDatabase, DEFAULT_RETRY_DELAY_MS, DEFAULT_CRUD_UPLOAD_THROTTLE_MS, BucketStorageAdapter, DBAdapter, PowerSyncBackendConnector, PowerSyncDatabaseOptionsWithSettings, RequiredAdditionalConnectionOptions, StreamingSyncImplementation } from '@powersync/common'; |
| 2 | +import { |
| 3 | + AbstractPowerSyncDatabase, |
| 4 | + DEFAULT_RETRY_DELAY_MS, |
| 5 | + DEFAULT_CRUD_UPLOAD_THROTTLE_MS, |
| 6 | + BucketStorageAdapter, |
| 7 | + DBAdapter, |
| 8 | + PowerSyncBackendConnector, |
| 9 | + PowerSyncDatabaseOptionsWithSettings, |
| 10 | + RequiredAdditionalConnectionOptions, |
| 11 | + StreamingSyncImplementation |
| 12 | +} from '@powersync/common'; |
3 | 13 | import { testSchema } from '../../utils/testDb'; |
4 | 14 |
|
5 | 15 | class TestPowerSyncDatabase extends AbstractPowerSyncDatabase { |
6 | 16 | protected openDBAdapter(options: PowerSyncDatabaseOptionsWithSettings): DBAdapter { |
7 | | - return {} as any |
| 17 | + return {} as any; |
8 | 18 | } |
9 | | - protected generateSyncStreamImplementation(connector: PowerSyncBackendConnector, options: RequiredAdditionalConnectionOptions): StreamingSyncImplementation { |
| 19 | + protected generateSyncStreamImplementation( |
| 20 | + connector: PowerSyncBackendConnector, |
| 21 | + options: RequiredAdditionalConnectionOptions |
| 22 | + ): StreamingSyncImplementation { |
10 | 23 | return undefined as any; |
11 | 24 | } |
12 | 25 | protected generateBucketStorageAdapter(): BucketStorageAdapter { |
13 | 26 | return { |
14 | 27 | init: vi.fn() |
15 | | - } as any |
| 28 | + } as any; |
16 | 29 | } |
17 | 30 | _initialize(): Promise<void> { |
18 | 31 | return Promise.resolve(); |
19 | 32 | } |
20 | 33 |
|
21 | 34 | get database() { |
22 | 35 | return { |
23 | | - get: vi.fn().mockResolvedValue({ version: '0.3.0'}), |
| 36 | + get: vi.fn().mockResolvedValue({ version: '0.3.0' }), |
24 | 37 | execute: vi.fn(), |
25 | | - refreshSchema: vi.fn(), |
26 | | - } as any |
| 38 | + refreshSchema: vi.fn() |
| 39 | + } as any; |
27 | 40 | } |
28 | 41 | // Expose protected method for testing |
29 | 42 | public testResolvedConnectionOptions(options?: any) { |
|
0 commit comments