mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
test(engine): drive the empty-screenshot probe test with fake timers (#7000)
This commit is contained in:
@@ -81,11 +81,18 @@ describe("BeginFrame capability probe", () => {
|
||||
}),
|
||||
} as unknown as Browser;
|
||||
|
||||
const result = await _probeBeginFrameSupportForTests(browser, 120);
|
||||
vi.useFakeTimers();
|
||||
try {
|
||||
const probing = _probeBeginFrameSupportForTests(browser, 120);
|
||||
await vi.advanceTimersByTimeAsync(200);
|
||||
const result = await probing;
|
||||
|
||||
expect(result.supported).toBe(false);
|
||||
expect(result.detail).toMatch(/returned 0 bytes after \d+ attempts in \d+ms/);
|
||||
expect(result.timedOut).toBe(true);
|
||||
expect(result.supported).toBe(false);
|
||||
expect(result.detail).toMatch(/returned 0 bytes after \d+ attempts in \d+ms/);
|
||||
expect(result.timedOut).toBe(true);
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
}
|
||||
});
|
||||
|
||||
it("reports frames that are not a PNG as unsupported, not as a slow start", async () => {
|
||||
|
||||
Reference in New Issue
Block a user