Skip to content

Commit f054e85

Browse files
test(server): type the fake goto's options
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 46467f2 commit f054e85

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎apps/server/src/preview/ServerBrowser.test.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function makeContext(onClose?: (context: BrowserContext) => void) {
215215
setViewportSize: vi.fn(async (size: typeof viewport) => {
216216
viewport = size;
217217
}),
218-
goto: vi.fn(async (next: string) => {
218+
goto: vi.fn(async (next: string, _options?: { timeout?: number }) => {
219219
const busyScript = renderer.busyScript;
220220
renderer.gotoStarted.resolve();
221221
if (busyScript) {
@@ -754,11 +754,8 @@ it.live.each(["load", "none"] as const)(
754754
expect(status.url).toBe("http://localhost:5173/next");
755755
expect(navigated).toMatchObject({ _tag: "Success" });
756756
// Waiting on the busy script spends the navigation's own budget.
757-
const [, gotoOptions] = contexts[0]!.page.goto.mock.calls.at(-1)! as [
758-
string,
759-
{ timeout: number },
760-
];
761-
expect(gotoOptions.timeout).toBeLessThan(200);
757+
const [, gotoOptions] = contexts[0]!.page.goto.mock.calls.at(-1)!;
758+
expect(gotoOptions?.timeout).toBeLessThan(200);
762759
expect(waited).toMatchObject({ _tag: "Success" });
763760
}),
764761
).pipe(Effect.provide(layer)),

0 commit comments

Comments
 (0)