From 4eb286e2cccb52493cbcfff2e1a36152a52f86ef Mon Sep 17 00:00:00 2001 From: can1357 Date: Sat, 2 May 2026 08:11:35 +0200 Subject: [PATCH] fix: type issues from esm --- packages/ai/test/issue-912-repro.test.ts | 2 +- packages/natives/test/issue-892-repro.test.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/ai/test/issue-912-repro.test.ts b/packages/ai/test/issue-912-repro.test.ts index 3a6c6b45e..5b4a7c896 100644 --- a/packages/ai/test/issue-912-repro.test.ts +++ b/packages/ai/test/issue-912-repro.test.ts @@ -58,7 +58,7 @@ describe("issue #912 — github-copilot abort propagation", () => { // signal — this is the regression vector. Real Bun fetch normally // propagates abort to the body reader, but we cannot rely on it for // every transport (HTTP/2, intermediaries, native sockets). - global.fetch = (async (input: RequestInfo | URL, _init?: RequestInit): Promise => { + global.fetch = (async (input: string | URL | Request, _init?: RequestInit): Promise => { const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url; if (!url.endsWith("/responses")) { throw new Error(`Unexpected fetch to ${url}`); diff --git a/packages/natives/test/issue-892-repro.test.ts b/packages/natives/test/issue-892-repro.test.ts index 598226de3..58519d175 100644 --- a/packages/natives/test/issue-892-repro.test.ts +++ b/packages/natives/test/issue-892-repro.test.ts @@ -57,8 +57,10 @@ describe("issue 892: pi-natives public surface", () => { // Mirror the failing consumer's package import (packages/utils/src/procmgr.ts, // packages/coding-agent/src/tools/browser/attach.ts). const mod = await import("@oh-my-pi/pi-natives"); - expect(mod.ProcessStatus).toBeDefined(); - expect(mod.ProcessStatus.Running).toBe("running"); - expect(mod.ProcessStatus.Exited).toBe("exited"); + const processStatusValues: Record<"Running" | "Exited", string> = { + Running: mod.ProcessStatus.Running, + Exited: mod.ProcessStatus.Exited, + }; + expect(processStatusValues).toEqual({ Running: "running", Exited: "exited" }); }); });