From 8a28086bf171ec924565a8c170acf85304eedb6e Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 15 Oct 2026 06:57:55 +0800 Subject: [PATCH] opendesign tests: the real fetch is put back after each test, so every package's tests after it pass again (publish red since #84) bun test runs every package's files in one process. opendesign's tests set globalThis.fetch directly, and mock.restore() doesn't undo that, so every file after it (minimax, trae, zcode, zen-free: 148 tests) got opendesign's stub and failed. The publish run at 3db704a went red at its test job, so neither dist nor npm ran. #84's review saw these failures and wrongly put them down to load. Run: `bun test packages/opendesign packages/minimax packages/zen-free packages/trae/usage.test.mjs` with HOME in a temp dir: 234 pass, 0 fail. Without this change: 34 fail. --- packages/opendesign/index.test.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/opendesign/index.test.mjs b/packages/opendesign/index.test.mjs index 652d7c0..3db2b85 100644 --- a/packages/opendesign/index.test.mjs +++ b/packages/opendesign/index.test.mjs @@ -4,8 +4,12 @@ import { OpenDesignAuthPlugin, } from "./index.mjs" +// bun test runs every package's files in one process: a fetch left +// stubbed here answers every test file after this one +const realFetch = globalThis.fetch afterEach(() => { mock.restore() + globalThis.fetch = realFetch }) // ---- the sign-in it keeps ----------------------------------------------------