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.
24 lines
730 B
24 lines
730 B
import { describe, expect, it } from "vitest";
|
|
import {
|
|
CHECK_PICKUP_IN_REACT_STATE,
|
|
INJECT_REACT_STATE,
|
|
INVOKE_CAPTURED_PLACE_CHANGED,
|
|
TRIGGER_GOOGLE_PLACE_CHANGED,
|
|
} from "@/workers/rpa/fix-place/browser-eval-scripts";
|
|
|
|
describe("fix-place/browser-eval-scripts", () => {
|
|
it("脚本为纯字符串,不含 esbuild helper 引用", () => {
|
|
const scripts = [
|
|
TRIGGER_GOOGLE_PLACE_CHANGED,
|
|
INVOKE_CAPTURED_PLACE_CHANGED,
|
|
CHECK_PICKUP_IN_REACT_STATE,
|
|
INJECT_REACT_STATE,
|
|
];
|
|
for (const script of scripts) {
|
|
expect(script).not.toMatch(/__name|__assign|__awaiter|__spread/);
|
|
expect(typeof script).toBe("string");
|
|
expect(script.length).toBeGreaterThan(10);
|
|
}
|
|
});
|
|
});
|