You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
866 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { describe, expect, it } from "vitest";
import { shouldRotateFlockSession } from "@/workers/rpa/flock/worker-session";
describe("shouldRotateFlockSession", () => {
it("注册被拒时轮换", () => {
expect(
shouldRotateFlockSession("FLOCK_ACCOUNT_REJECTED: We had an issue creating your account"),
).toBe(true);
});
it("邮箱已存在时轮换", () => {
expect(shouldRotateFlockSession("FLOCK_ACCOUNT_EXISTS: already registered")).toBe(
true,
);
});
it("报价上限时轮换", () => {
expect(
shouldRotateFlockSession(
"FLOCK_QUOTE_LIMIT官网提示 Thank you for your interest获取报价已达上限",
),
).toBe(false);
});
it("普通报价失败不轮换", () => {
expect(shouldRotateFlockSession("RPA_DATA_INVALID20s 内未拿到报价")).toBe(false);
});
});