完成40%

This commit is contained in:
rain
2026-07-23 17:21:27 +08:00
parent f1edc6b533
commit bb6431b319
114 changed files with 10931 additions and 877 deletions
+27 -2
View File
@@ -14,12 +14,12 @@ const run = async () => {
);
const {
AUTH_TAC_SCENE,
PASSWORD_TAC_BLOCKED_MESSAGE,
isAuthPhone,
assertSmsCode,
normalizeCaptchaRequirement,
createTacRenderContext,
normalizeTacSuccess,
isSmsDeliveryOutcomeUnknown,
} = await import(toDataModuleUrl(source));
assert.deepStrictEqual(
@@ -31,7 +31,6 @@ const run = async () => {
},
"认证 TAC 场景必须由受保护 OpenAPI 的唯一枚举拥有",
);
assert.match(PASSWORD_TAC_BLOCKED_MESSAGE, /服务端|安全验证|验证码登录/);
assert.strictEqual(isAuthPhone("13800138000"), true);
for (const invalid of ["", "12800138000", "1380013800", "138001380000", 13800138000, null]) {
@@ -123,6 +122,32 @@ const run = async () => {
/票据/,
);
for (const error of [
{ code: "REQUEST_TIMEOUT" },
{ code: "NETWORK_ERROR" },
{ code: "RESPONSE_INVALID" },
{ code: "REQUEST_CANCELLED" },
{ code: "HTTP_ERROR", httpStatus: 201 },
{ code: "HTTP_ERROR", httpStatus: 204 },
{ code: "HTTP_ERROR", httpStatus: 302 },
{ code: "HTTP_ERROR", httpStatus: 408 },
{ code: "HTTP_ERROR", httpStatus: 500 },
{ code: "BUSINESS_ERROR", businessCode: 408 },
{ code: "BUSINESS_ERROR", businessCode: 500 },
]) {
assert.strictEqual(isSmsDeliveryOutcomeUnknown(error), true);
}
for (const error of [
null,
{ code: "HTTP_ERROR", httpStatus: 400 },
{ code: "HTTP_ERROR", httpStatus: 401 },
{ code: "HTTP_ERROR", httpStatus: 422 },
{ code: "HTTP_ERROR", httpStatus: 429 },
{ code: "BUSINESS_ERROR", businessCode: 429 },
]) {
assert.strictEqual(isSmsDeliveryOutcomeUnknown(error), false);
}
process.stdout.write("AUTH-VERIFICATION-RUNTIME-SMOKE PASS\n");
};