test: tighten script empty array assertions · openclaw/openclaw@ef2be8a
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -140,6 +140,6 @@ describe("syncPluginVersions", () => {
|
140 | 140 | |
141 | 141 | const checkSummary = syncPluginVersions(rootDir, { write: false }); |
142 | 142 | |
143 | | -expect(checkSummary.changelogged).toEqual([]); |
| 143 | +expect(checkSummary.changelogged).toStrictEqual([]); |
144 | 144 | }); |
145 | 145 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -888,10 +888,10 @@ describe("test-projects args", () => {
|
888 | 888 | }); |
889 | 889 | expect( |
890 | 890 | resolveChangedTargetArgs(["--changed=origin/main"], process.cwd(), () => changedPaths), |
891 | | -).toEqual([]); |
| 891 | +).toStrictEqual([]); |
892 | 892 | expect( |
893 | 893 | buildVitestRunPlans(["--changed=origin/main"], process.cwd(), () => changedPaths), |
894 | | -).toEqual([]); |
| 894 | +).toStrictEqual([]); |
895 | 895 | }); |
896 | 896 | |
897 | 897 | it("keeps core test-only changes on their owning test lane", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -60,7 +60,7 @@ describe("bundled plugin assets", () => {
|
60 | 60 | await withPluginAssetFixture(async (rootDir) => { |
61 | 61 | await expect( |
62 | 62 | readBundledPluginAssetHooks({ phase: "copy", plugins: ["missing"], rootDir }), |
63 | | -).resolves.toEqual([]); |
| 63 | +).resolves.toStrictEqual([]); |
64 | 64 | }); |
65 | 65 | }); |
66 | 66 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -70,8 +70,8 @@ describe("check-cli-bootstrap-imports", () => {
|
70 | 70 | writeFixture(root, "dist/light.js", `import path from "node:path";\nvoid path;\n`); |
71 | 71 | writeGatewayRunChunk(root); |
72 | 72 | |
73 | | -expect(collectCliBootstrapExternalImportErrors({ rootDir: root })).toEqual([]); |
74 | | -expect(collectGatewayRunChunkBudgetErrors({ rootDir: root })).toEqual([]); |
| 73 | +expect(collectCliBootstrapExternalImportErrors({ rootDir: root })).toStrictEqual([]); |
| 74 | +expect(collectGatewayRunChunkBudgetErrors({ rootDir: root })).toStrictEqual([]); |
75 | 75 | }); |
76 | 76 | |
77 | 77 | it("reports external packages in the static bootstrap graph", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -24,7 +24,7 @@ describe("check-dynamic-import-warts", () => {
|
24 | 24 | return (await import("./runtime.js")).createRuntime(); |
25 | 25 | } |
26 | 26 | `; |
27 | | -expect(findDynamicImportAdvisories(source)).toEqual([]); |
| 27 | +expect(findDynamicImportAdvisories(source)).toStrictEqual([]); |
28 | 28 | }); |
29 | 29 | |
30 | 30 | it("flags repeated direct dynamic imports", () => { |
@@ -52,7 +52,7 @@ describe("check-dynamic-import-warts", () => {
|
52 | 52 | return runtimePromise; |
53 | 53 | } |
54 | 54 | `; |
55 | | -expect(findDynamicImportAdvisories(source)).toEqual([]); |
| 55 | +expect(findDynamicImportAdvisories(source)).toStrictEqual([]); |
56 | 56 | }); |
57 | 57 | |
58 | 58 | it("flags direct dynamic imports inside execute paths", () => { |
@@ -87,6 +87,6 @@ describe("check-dynamic-import-warts", () => {
|
87 | 87 | }; |
88 | 88 | } |
89 | 89 | `; |
90 | | -expect(findDynamicImportAdvisories(source)).toEqual([]); |
| 90 | +expect(findDynamicImportAdvisories(source)).toStrictEqual([]); |
91 | 91 | }); |
92 | 92 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,7 @@ describe("check-no-conflict-markers", () => {
|
39 | 39 | findConflictMarkerLines( |
40 | 40 | ["Example:", " <<<<<<< HEAD", "const text = '======= not a conflict';"].join("\n"), |
41 | 41 | ), |
42 | | -).toEqual([]); |
| 42 | +).toStrictEqual([]); |
43 | 43 | }); |
44 | 44 | |
45 | 45 | it("scans text files and skips binary files", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,15 +34,15 @@ describe("check-no-random-messaging-tmp", () => {
|
34 | 34 | // os.tmpdir() |
35 | 35 | const text = "tmpdir()"; |
36 | 36 | `; |
37 | | -expect(findMessagingTmpdirCallLines(source)).toEqual([]); |
| 37 | +expect(findMessagingTmpdirCallLines(source)).toStrictEqual([]); |
38 | 38 | }); |
39 | 39 | |
40 | 40 | it("ignores tmpdir symbols that are not imported from node:os", () => { |
41 | 41 | const source = ` |
42 | 42 | const tmpdir = () => "/tmp"; |
43 | 43 | const dir = tmpdir(); |
44 | 44 | `; |
45 | | -expect(findMessagingTmpdirCallLines(source)).toEqual([]); |
| 45 | +expect(findMessagingTmpdirCallLines(source)).toStrictEqual([]); |
46 | 46 | }); |
47 | 47 | |
48 | 48 | it("guards src/media against host tmpdir usage", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -25,7 +25,7 @@ describe("check-no-raw-window-open", () => {
|
25 | 25 | // window.open("https://example.com") |
26 | 26 | const text = "window.open('https://example.com')"; |
27 | 27 | `; |
28 | | -expect(findRawWindowOpenLines(source)).toEqual([]); |
| 28 | +expect(findRawWindowOpenLines(source)).toStrictEqual([]); |
29 | 29 | }); |
30 | 30 | |
31 | 31 | it("handles parenthesized and asserted window references", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,7 +13,7 @@ const validRule = {
|
13 | 13 | |
14 | 14 | describe("check-opengrep-rule-metadata", () => { |
15 | 15 | it("accepts GHSA-backed rules with durable source metadata", () => { |
16 | | -expect(validateRuleMetadata([validRule])).toEqual([]); |
| 16 | +expect(validateRuleMetadata([validRule])).toStrictEqual([]); |
17 | 17 | }); |
18 | 18 | |
19 | 19 | it("requires source metadata on every compiled rule", () => { |
@@ -46,7 +46,7 @@ describe("check-opengrep-rule-metadata", () => {
|
46 | 46 | }, |
47 | 47 | }, |
48 | 48 | ]), |
49 | | -).toEqual([]); |
| 49 | +).toStrictEqual([]); |
50 | 50 | }); |
51 | 51 | |
52 | 52 | it("keeps the source id, rule id, and GHSA advisory URL consistent", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,7 +42,7 @@ describe("check-runtime-sidecar-loaders", () => {
|
42 | 42 | "src/tasks/task-registry.ts", |
43 | 43 | new Set(["src/tasks/task-registry-control.runtime.ts"]), |
44 | 44 | ), |
45 | | -).toEqual([]); |
| 45 | +).toStrictEqual([]); |
46 | 46 | }); |
47 | 47 | |
48 | 48 | it("resolves candidate arrays used by source/build fallback loops", () => { |
@@ -81,7 +81,7 @@ describe("check-runtime-sidecar-loaders", () => {
|
81 | 81 | |
82 | 82 | expect( |
83 | 83 | findRuntimeSidecarLoaderViolations(source, "src/tasks/task-registry.ts", new Set()), |
84 | | -).toEqual([]); |
| 84 | +).toStrictEqual([]); |
85 | 85 | }); |
86 | 86 | |
87 | 87 | it("collects explicit tsdown entry sources", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。