diff --git a/src/app/repo/scripts.test.ts b/src/app/repo/scripts.test.ts new file mode 100644 index 000000000..54f040456 --- /dev/null +++ b/src/app/repo/scripts.test.ts @@ -0,0 +1,154 @@ +import { describe, it, expect, beforeEach } from "vitest"; +import { + ScriptDAO, + type Script, + SCRIPT_TYPE_NORMAL, + SCRIPT_STATUS_ENABLE, + SCRIPT_RUN_STATUS_COMPLETE, +} from "./scripts"; + +const baseMeta = { + name: ["测试脚本"], + namespace: ["test-namespace"], + version: ["1.0.0"], + author: ["测试作者"], + copyright: ["(c) 测试"], + grant: ["GM_xmlhttpRequest"], + match: ["https://example.com/*"], + license: ["MIT"], +}; + +const makeBaseScript = (overrides: Partial