认证页面用例统一用throw表达拒绝
- 业务变体用例的 Promise.reject 改为 throw,与相邻用例风格一致、不与已 resolved 混淆
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user