Open History to see the last commit
1// Helpers shared by the refetch-ordered-prefix oracle and its ordinary unit
2// tests in refetch-ordered-prefix.test.ts. Neither owns a law here.
3
4export async function settle(): Promise<void> {
5 for (let turn = 0; turn < 20; turn++) {
6 await new Promise((resolve) => setTimeout(resolve, 0))
7 }
8}
9
10export function sameOrderedIds(
11 actual: ReadonlyArray<number>,
12 expected: ReadonlyArray<number>,
13): boolean {
14 return (
15 actual.length === expected.length &&
16 expected.every((id, index) => actual[index] === id)
17 )
18}