test: sync updated specs

This commit is contained in:
Peter Steinberger
2025-11-25 12:12:29 +01:00
parent 800c7a1e1f
commit 38659f5d3e
10 changed files with 100 additions and 94 deletions

View File

@@ -38,21 +38,18 @@ describe("command queue", () => {
await new Promise((resolve) => setTimeout(resolve, 30));
});
const second = enqueueCommand(
async () => {},
{
warnAfterMs: 5,
onWait: (ms, ahead) => {
waited = ms;
queuedAhead = ahead;
},
const second = enqueueCommand(async () => {}, {
warnAfterMs: 5,
onWait: (ms, ahead) => {
waited = ms;
queuedAhead = ahead;
},
);
});
await Promise.all([first, second]);
expect(waited).not.toBeNull();
expect((waited as number)).toBeGreaterThanOrEqual(5);
expect(waited as number).toBeGreaterThanOrEqual(5);
expect(queuedAhead).toBe(0);
});
});