From 7278023cb771142157bba6bb3ce62043ad416ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 2 Oct 2026 11:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E9=A1=B5=E9=9D=A2=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E7=BB=9F=E4=B8=80=E7=94=A8throw=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E6=8B=92=E7=BB=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 业务变体用例的 Promise.reject 改为 throw,与相邻用例风格一致、不与已 resolved 混淆 --- .../tests/appSurface/auth.suite.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/ai-game-creator-shell/tests/appSurface/auth.suite.ts b/apps/ai-game-creator-shell/tests/appSurface/auth.suite.ts index 71c9baf12..3f7c5912b 100644 --- a/apps/ai-game-creator-shell/tests/appSurface/auth.suite.ts +++ b/apps/ai-game-creator-shell/tests/appSurface/auth.suite.ts @@ -328,12 +328,10 @@ export function registerAuthTests() { const invoke = vi.fn(async (command: string) => { if (command === 'read_client_auth_state') { reads += 1; - return reads === 1 - ? Promise.reject({ - type: 'serverAddressRejected', - reason: 'notHttps', - }) - : { status: 'unauthenticated' }; + if (reads === 1) { + throw { type: 'serverAddressRejected', reason: 'notHttps' }; + } + return { status: 'unauthenticated' }; } return null; });