test: tighten core io empty array assertions

This commit is contained in:
Shakker
2026-05-09 05:29:43 +01:00
parent ef214587fd
commit e771e251eb
8 changed files with 11 additions and 11 deletions

View File

@@ -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([]);
});
});

View File

@@ -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();
});

View File

@@ -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", () => {

View File

@@ -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();
});

View File

@@ -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([

View File

@@ -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);

View File

@@ -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 {

View File

@@ -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", () => {