test: tighten core io empty array assertions · openclaw/openclaw@e771e25
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
File tree
file-transfer/src/node-host
| Original file line number | Diff line number | Diff line change |
|---|
@@ -77,7 +77,7 @@ describe("handleFileWrite — happy path", () => {
|
77 | 77 | |
78 | 78 | const entries = await fs.readdir(tmpRoot); |
79 | 79 | const tmpFiles = entries.filter((n) => n.includes(".tmp")); |
80 | | -expect(tmpFiles).toEqual([]); |
| 80 | +expect(tmpFiles).toStrictEqual([]); |
81 | 81 | }); |
82 | 82 | }); |
83 | 83 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -276,7 +276,7 @@ describe("openshell fs bridges", () => {
|
276 | 276 | await expect(fs.stat(path.join(outsideDir, "escape.txt"))).rejects.toMatchObject({ |
277 | 277 | code: "ENOENT", |
278 | 278 | }); |
279 | | -await expect(fs.readdir(outsideDir)).resolves.toEqual([]); |
| 279 | +await expect(fs.readdir(outsideDir)).resolves.toStrictEqual([]); |
280 | 280 | expect(backend.syncLocalPathToRemote).not.toHaveBeenCalled(); |
281 | 281 | }); |
282 | 282 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -50,7 +50,7 @@ describe("error helpers", () => {
|
50 | 50 | ...((current as { errors?: unknown[] }).errors ?? []), |
51 | 51 | ]), |
52 | 52 | ).toEqual([root, child, leaf]); |
53 | | -expect(collectErrorGraphCandidates(null)).toEqual([]); |
| 53 | +expect(collectErrorGraphCandidates(null)).toStrictEqual([]); |
54 | 54 | }); |
55 | 55 | |
56 | 56 | it("matches errno-shaped errors by code", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -356,7 +356,7 @@ describe("startHeartbeatRunner", () => {
|
356 | 356 | const scheduledSlotCallsBeforeInterval = callTimes.filter( |
357 | 357 | (time) => time >= firstDueMs + intervalMs, |
358 | 358 | ); |
359 | | -expect(scheduledSlotCallsBeforeInterval).toEqual([]); |
| 359 | +expect(scheduledSlotCallsBeforeInterval).toStrictEqual([]); |
360 | 360 | |
361 | 361 | // The next interval tick at the next scheduled slot should still fire — |
362 | 362 | // the retries must not push the phase out by multiple intervals. |
@@ -508,7 +508,7 @@ describe("startHeartbeatRunner", () => {
|
508 | 508 | }, |
509 | 509 | }); |
510 | 510 | const financeCalls = runSpy.mock.calls.filter((call) => call[0]?.agentId === "finance"); |
511 | | -expect(financeCalls).toEqual([]); |
| 511 | +expect(financeCalls).toStrictEqual([]); |
512 | 512 | |
513 | 513 | runner.stop(); |
514 | 514 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -25,7 +25,7 @@ describe("path prepend helpers", () => {
|
25 | 25 | expect( |
26 | 26 | normalizePathPrepend([" /custom/bin ", "", " /custom/bin ", "/opt/bin", 42 as any]), |
27 | 27 | ).toEqual(["/custom/bin", "/opt/bin"]); |
28 | | -expect(normalizePathPrepend()).toEqual([]); |
| 28 | +expect(normalizePathPrepend()).toStrictEqual([]); |
29 | 29 | }); |
30 | 30 | |
31 | 31 | it.each([ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -95,7 +95,7 @@ describe("resolveProviderAuths plugin boundary", () => {
|
95 | 95 | skipPluginAuthWithoutCredentialSource: true, |
96 | 96 | env: { HOME: homeDir }, |
97 | 97 | }), |
98 | | -).resolves.toEqual([]); |
| 98 | +).resolves.toStrictEqual([]); |
99 | 99 | }); |
100 | 100 | |
101 | 101 | expect(resolveProviderUsageAuthWithPluginMock).not.toHaveBeenCalled(); |
@@ -304,7 +304,7 @@ describe("resolveProviderAuths plugin boundary", () => {
|
304 | 304 | skipPluginAuthWithoutCredentialSource: true, |
305 | 305 | env: { HOME: homeDir }, |
306 | 306 | }), |
307 | | -).resolves.toEqual([]); |
| 307 | +).resolves.toStrictEqual([]); |
308 | 308 | }); |
309 | 309 | |
310 | 310 | expect(ensureAuthProfileStoreWithoutExternalProfilesMock).toHaveBeenCalledTimes(1); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1323,7 +1323,7 @@ describe("handleSystemRunInvoke mac app exec host routing", () => {
|
1323 | 1323 | |
1324 | 1324 | expect(runCommand).toHaveBeenCalledTimes(1); |
1325 | 1325 | expectInvokeOk(sendInvokeResult, { payloadContains: "inline-eval-ok" }); |
1326 | | -expect(loadExecApprovals().agents?.main?.allowlist ?? []).toEqual([]); |
| 1326 | +expect(loadExecApprovals().agents?.main?.allowlist ?? []).toStrictEqual([]); |
1327 | 1327 | }, |
1328 | 1328 | }); |
1329 | 1329 | } finally { |
@@ -1427,7 +1427,7 @@ describe("handleSystemRunInvoke mac app exec host routing", () => {
|
1427 | 1427 | |
1428 | 1428 | expect(runCommand).toHaveBeenCalledTimes(1); |
1429 | 1429 | expectInvokeOk(sendInvokeResult, { payloadContains: "inline-eval-ok" }); |
1430 | | -expect(loadExecApprovals().agents?.main?.allowlist ?? []).toEqual([]); |
| 1430 | +expect(loadExecApprovals().agents?.main?.allowlist ?? []).toStrictEqual([]); |
1431 | 1431 | }, |
1432 | 1432 | }); |
1433 | 1433 | } finally { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -51,7 +51,7 @@ describe("extractUrls", () => {
|
51 | 51 | }); |
52 | 52 | |
53 | 53 | it("returns empty array for text without URLs", () => { |
54 | | -expect(extractUrls("No links here")).toEqual([]); |
| 54 | +expect(extractUrls("No links here")).toStrictEqual([]); |
55 | 55 | }); |
56 | 56 | |
57 | 57 | it("handles URLs with query params and fragments", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。