From d9a6c45c64b69632615cda28e8cfe0d9b9f930e9 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 4 Nov 2026 18:49:43 +0800 Subject: [PATCH] minimax: the China-site test reads 401 as a word, not inside the fake's port region.test.mjs checked the account card's error with not.toMatch(/refused|401/). The error names the fake's address, 127.0.0.1:, so any port with 401 in it (40199 on CI, the publish run for aaacefde) turned the test red and held back that publish. It now matches /refused|\b401\b/, which still catches an "HTTP 401". Run (Bun 1.4.4 38afee6c8, mote): with the fake forced to port 40199, the old assertion is red (1 fail, the 40199 message) and the new one green; bun test packages/minimax 128 pass, 0 fail at the random port. No other negative status-code match in packages/ (grepped not.toMatch / doesNotMatch with a 3-digit pattern). --- packages/minimax/region.test.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/minimax/region.test.mjs b/packages/minimax/region.test.mjs index 73a839e..b7cdbd3 100644 --- a/packages/minimax/region.test.mjs +++ b/packages/minimax/region.test.mjs @@ -45,7 +45,9 @@ test("the account card says the request went to the China site, not that the sig const u = await hooks.auth.usage(async () => auth) expect(u.error).toMatch(china) expect(u.error).toMatch(/proxy outside mainland China/) - expect(u.error).not.toMatch(/refused|401/) + // The fake listens on a random port, so 401 counts only as a word: a port + // like 40199 in the message is not a 401 (CI red at aaacefde). + expect(u.error).not.toMatch(/refused|\b401\b/) expect(u.signIn).toBe("kept") expect(f.seen.some((r) => r.path === "/oauth2/token")).toBe(false) })