mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 10:40:44 +00:00
test: tighten core io empty array assertions
This commit is contained in:
@@ -77,7 +77,7 @@ describe("handleFileWrite — happy path", () => {
|
||||
|
||||
const entries = await fs.readdir(tmpRoot);
|
||||
const tmpFiles = entries.filter((n) => n.includes(".tmp"));
|
||||
expect(tmpFiles).toEqual([]);
|
||||
expect(tmpFiles).toStrictEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ describe("openshell fs bridges", () => {
|
||||
await expect(fs.stat(path.join(outsideDir, "escape.txt"))).rejects.toMatchObject({
|
||||
code: "ENOENT",
|
||||
});
|
||||
await expect(fs.readdir(outsideDir)).resolves.toEqual([]);
|
||||
await expect(fs.readdir(outsideDir)).resolves.toStrictEqual([]);
|
||||
expect(backend.syncLocalPathToRemote).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ describe("error helpers", () => {
|
||||
...((current as { errors?: unknown[] }).errors ?? []),
|
||||
]),
|
||||
).toEqual([root, child, leaf]);
|
||||
expect(collectErrorGraphCandidates(null)).toEqual([]);
|
||||
expect(collectErrorGraphCandidates(null)).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("matches errno-shaped errors by code", () => {
|
||||
|
||||
@@ -356,7 +356,7 @@ describe("startHeartbeatRunner", () => {
|
||||
const scheduledSlotCallsBeforeInterval = callTimes.filter(
|
||||
(time) => time >= firstDueMs + intervalMs,
|
||||
);
|
||||
expect(scheduledSlotCallsBeforeInterval).toEqual([]);
|
||||
expect(scheduledSlotCallsBeforeInterval).toStrictEqual([]);
|
||||
|
||||
// The next interval tick at the next scheduled slot should still fire —
|
||||
// the retries must not push the phase out by multiple intervals.
|
||||
@@ -508,7 +508,7 @@ describe("startHeartbeatRunner", () => {
|
||||
},
|
||||
});
|
||||
const financeCalls = runSpy.mock.calls.filter((call) => call[0]?.agentId === "finance");
|
||||
expect(financeCalls).toEqual([]);
|
||||
expect(financeCalls).toStrictEqual([]);
|
||||
|
||||
runner.stop();
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ describe("path prepend helpers", () => {
|
||||
expect(
|
||||
normalizePathPrepend([" /custom/bin ", "", " /custom/bin ", "/opt/bin", 42 as any]),
|
||||
).toEqual(["/custom/bin", "/opt/bin"]);
|
||||
expect(normalizePathPrepend()).toEqual([]);
|
||||
expect(normalizePathPrepend()).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it.each([
|
||||
|
||||
@@ -95,7 +95,7 @@ describe("resolveProviderAuths plugin boundary", () => {
|
||||
skipPluginAuthWithoutCredentialSource: true,
|
||||
env: { HOME: homeDir },
|
||||
}),
|
||||
).resolves.toEqual([]);
|
||||
).resolves.toStrictEqual([]);
|
||||
});
|
||||
|
||||
expect(resolveProviderUsageAuthWithPluginMock).not.toHaveBeenCalled();
|
||||
@@ -304,7 +304,7 @@ describe("resolveProviderAuths plugin boundary", () => {
|
||||
skipPluginAuthWithoutCredentialSource: true,
|
||||
env: { HOME: homeDir },
|
||||
}),
|
||||
).resolves.toEqual([]);
|
||||
).resolves.toStrictEqual([]);
|
||||
});
|
||||
|
||||
expect(ensureAuthProfileStoreWithoutExternalProfilesMock).toHaveBeenCalledTimes(1);
|
||||
|
||||
@@ -1323,7 +1323,7 @@ describe("handleSystemRunInvoke mac app exec host routing", () => {
|
||||
|
||||
expect(runCommand).toHaveBeenCalledTimes(1);
|
||||
expectInvokeOk(sendInvokeResult, { payloadContains: "inline-eval-ok" });
|
||||
expect(loadExecApprovals().agents?.main?.allowlist ?? []).toEqual([]);
|
||||
expect(loadExecApprovals().agents?.main?.allowlist ?? []).toStrictEqual([]);
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
@@ -1427,7 +1427,7 @@ describe("handleSystemRunInvoke mac app exec host routing", () => {
|
||||
|
||||
expect(runCommand).toHaveBeenCalledTimes(1);
|
||||
expectInvokeOk(sendInvokeResult, { payloadContains: "inline-eval-ok" });
|
||||
expect(loadExecApprovals().agents?.main?.allowlist ?? []).toEqual([]);
|
||||
expect(loadExecApprovals().agents?.main?.allowlist ?? []).toStrictEqual([]);
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("extractUrls", () => {
|
||||
});
|
||||
|
||||
it("returns empty array for text without URLs", () => {
|
||||
expect(extractUrls("No links here")).toEqual([]);
|
||||
expect(extractUrls("No links here")).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("handles URLs with query params and fragments", () => {
|
||||
|
||||
Reference in New Issue
Block a user