(
query: Collection<T>,
options: {
minSize?: number
timeout?: number
} = {},
)
| 120 | * snapshot data asynchronously after loadSubset is triggered. |
| 121 | */ |
| 122 | export async function waitForQueryData<T extends object>( |
| 123 | query: Collection<T>, |
| 124 | options: { |
| 125 | minSize?: number |
| 126 | timeout?: number |
| 127 | } = {}, |
| 128 | ): Promise<void> { |
| 129 | const { minSize = 1, timeout = 2000 } = options |
| 130 | |
| 131 | await waitFor(() => query.size >= minSize, { |
| 132 | timeout, |
| 133 | interval: 10, |
| 134 | message: `Query did not load data (expected >= ${minSize}, got ${query.size})`, |
| 135 | }) |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Create a deduplication counter for testing |
no test coverage detected