(operation: () => Promise<T> | T)
| 13 | } |
| 14 | |
| 15 | function enqueueTestDatabaseOperation<T>(operation: () => Promise<T> | T): Promise<T> { |
| 16 | const testGlobal = globalThis as TestDatabaseGlobal; |
| 17 | const result = (testGlobal[TEST_DATABASE_OPERATION_QUEUE_KEY] ?? Promise.resolve()).then( |
| 18 | operation, |
| 19 | ); |
| 20 | testGlobal[TEST_DATABASE_OPERATION_QUEUE_KEY] = result.then( |
| 21 | () => undefined, |
| 22 | () => undefined, |
| 23 | ); |
| 24 | return result; |
| 25 | } |
| 26 | |
| 27 | export async function registerTestDatabaseClient(client: TestDatabaseClient): Promise<void> { |
| 28 | await enqueueTestDatabaseOperation(() => { |
no test coverage detected
searching dependent graphs…