38 lines · 991 B · TypeScript
RawDownload
import { describe, expect, it } from "vite-plus/test"; import { waitForThreadShellReady } from "./threadForkNavigation"; describe("waitForThreadShellReady", () => {  it("returns true when the forked thread shell arrives before the deadline", async () => {    let elapsedMs = 0;     const ready = await waitForThreadShellReady({      read: () => elapsedMs >= 80,      timeoutMs: 120,      pollIntervalMs: 40,      now: () => elapsedMs,      delay: async (durationMs) => {        elapsedMs += durationMs;      },    });     expect(ready).toBe(true);  });   it("returns false instead of navigating when the shell never arrives", async () => {    let elapsedMs = 0;     const ready = await waitForThreadShellReady({      read: () => false,      timeoutMs: 80,      pollIntervalMs: 40,      now: () => elapsedMs,      delay: async (durationMs) => {        elapsedMs += durationMs;      },    });     expect(ready).toBe(false);    expect(elapsedMs).toBe(80);  });});

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t