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:<random port>, 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).
This commit is contained in:
yetone
2026-11-04 18:49:47 +08:00
parent aaacefdea8
commit d9a6c45c64
+3 -1
View File
@@ -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)
})