-
Notifications
You must be signed in to change notification settings - Fork 392
Expand file tree
/
Copy pathunwrap_e2e_test.js
More file actions
56 lines (49 loc) · 1.28 KB
/
Copy pathunwrap_e2e_test.js
File metadata and controls
56 lines (49 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// ==UserScript==
// @name Unwrap E2E Test
// @namespace https://docs.scriptcat.org/
// @version 1.0.0
// @description E2E 测试 @unwrap 功能
// @author ScriptCat
// @match https://content-security-policy.com/?unwrap_e2e_test
// @grant GM_setValue
// @require https://cdn.jsdelivr.net/gh/scriptscat/scriptcat@b8c6d0839c75ee5e4e4276dd10e201011c445df8/example/tests/lib/sctest.js
// @unwrap
// ==/UserScript==
var __unwrap_e2e_global_var = "unwrap_success";
(function () {
"use strict";
const { describe, check, expect, run } = SCTest.create({ name: "@unwrap E2E 测试" });
describe("@unwrap 环境", () => {
check(
"自动断言",
"GM 对象在 unwrap 模式下为 undefined",
() => {
expect(typeof GM).toBe("undefined");
},
null,
null,
null
);
check(
"自动断言",
"GM_setValue 在 unwrap 模式下为 undefined",
() => {
expect(typeof GM_setValue).toBe("undefined");
},
null,
null,
null
);
check(
"自动断言",
"全局变量可在页面作用域访问",
() => {
expect(window.__unwrap_e2e_global_var).toBe("unwrap_success");
},
null,
null,
null
);
});
run();
})();