test: tighten script empty array assertions

This commit is contained in:
Shakker
2026-05-09 05:03:40 +01:00
parent e68206deed
commit b33fe72fc3
9 changed files with 39 additions and 39 deletions

View File

@@ -403,10 +403,10 @@ describe("barnacle-auto-response", () => {
}, },
}); });
expect(calls.addLabels).toEqual([]); expect(calls.addLabels).toStrictEqual([]);
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.removeLabel).toEqual([]); expect(calls.removeLabel).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("leaves stale Barnacle labels alone on maintainer-authored PRs", async () => { it("leaves stale Barnacle labels alone on maintainer-authored PRs", async () => {
@@ -433,10 +433,10 @@ describe("barnacle-auto-response", () => {
}, },
}); });
expect(calls.addLabels).toEqual([]); expect(calls.addLabels).toStrictEqual([]);
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.removeLabel).toEqual([]); expect(calls.removeLabel).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("does not mutate maintainer-authored issues", async () => { it("does not mutate maintainer-authored issues", async () => {
@@ -456,9 +456,9 @@ describe("barnacle-auto-response", () => {
}, },
}); });
expect(calls.addLabels).toEqual([]); expect(calls.addLabels).toStrictEqual([]);
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("does not action close labels on maintainer-authored issues", async () => { it("does not action close labels on maintainer-authored issues", async () => {
@@ -485,8 +485,8 @@ describe("barnacle-auto-response", () => {
}, },
}); });
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("closes issues tagged as false positives", async () => { it("closes issues tagged as false positives", async () => {
@@ -541,8 +541,8 @@ describe("barnacle-auto-response", () => {
}, },
}); });
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("does not close automation PRs for the active PR limit", async () => { it("does not close automation PRs for the active PR limit", async () => {
@@ -606,8 +606,8 @@ describe("barnacle-auto-response", () => {
}); });
expect(calls.removeLabel).toContainEqual(expect.objectContaining({ name: "r: too-many-prs" })); expect(calls.removeLabel).toContainEqual(expect.objectContaining({ name: "r: too-many-prs" }));
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("does not close GitHub App-authored PRs when stale PR-limit label removal returns 404", async () => { it("does not close GitHub App-authored PRs when stale PR-limit label removal returns 404", async () => {
@@ -632,8 +632,8 @@ describe("barnacle-auto-response", () => {
}); });
expect(calls.removeLabel).toContainEqual(expect.objectContaining({ name: "r: too-many-prs" })); expect(calls.removeLabel).toContainEqual(expect.objectContaining({ name: "r: too-many-prs" }));
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("still adds candidate labels to broad contributor PRs", async () => { it("still adds candidate labels to broad contributor PRs", async () => {
@@ -657,8 +657,8 @@ describe("barnacle-auto-response", () => {
labels: expect.arrayContaining([candidateLabels.dirtyCandidate]), labels: expect.arrayContaining([candidateLabels.dirtyCandidate]),
}), }),
); );
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("adds proof labels to external PRs without auto-closing by default", async () => { it("adds proof labels to external PRs without auto-closing by default", async () => {
@@ -677,8 +677,8 @@ describe("barnacle-auto-response", () => {
labels: expect.arrayContaining([candidateLabels.needsRealBehaviorProof]), labels: expect.arrayContaining([candidateLabels.needsRealBehaviorProof]),
}), }),
); );
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("removes stale proof labels when override is present", async () => { it("removes stale proof labels when override is present", async () => {
@@ -706,7 +706,7 @@ describe("barnacle-auto-response", () => {
PROOF_SUFFICIENT_LABEL, PROOF_SUFFICIENT_LABEL,
]), ]),
); );
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("removes stale negative proof labels and adds supplied when proof is present", async () => { it("removes stale negative proof labels and adds supplied when proof is present", async () => {
@@ -856,8 +856,8 @@ describe("barnacle-auto-response", () => {
}, },
}); });
expect(calls.createComment).toEqual([]); expect(calls.createComment).toStrictEqual([]);
expect(calls.update).toEqual([]); expect(calls.update).toStrictEqual([]);
}); });
it("actions existing candidate labels when a maintainer adds trigger-response", async () => { it("actions existing candidate labels when a maintainer adds trigger-response", async () => {

View File

@@ -119,7 +119,7 @@ describe("bundled plugin build entries", () => {
expect(entry).toContain('specifier: "./secret-contract-api.js"'); expect(entry).toContain('specifier: "./secret-contract-api.js"');
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
for (const pluginId of [...secretBackedPluginIds].toSorted()) { for (const pluginId of [...secretBackedPluginIds].toSorted()) {
if (excludedPackageDirs.has(pluginId)) { if (excludedPackageDirs.has(pluginId)) {
@@ -146,6 +146,6 @@ describe("bundled plugin build entries", () => {
} }
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
}); });

View File

@@ -24,7 +24,7 @@ describe("check-changelog-attributions", () => {
findForbiddenChangelogThanks( findForbiddenChangelogThanks(
"- User-facing fix. Fixes #123. Thanks @external-contributor and @other-user.", "- User-facing fix. Fixes #123. Thanks @external-contributor and @other-user.",
), ),
).toEqual([]); ).toStrictEqual([]);
}); });
it("keeps PR changelog gates on the same attribution policy", () => { it("keeps PR changelog gates on the same attribution policy", () => {

View File

@@ -64,7 +64,7 @@ describe("check-channel-agnostic-boundaries", () => {
const payload = { mode: "persistent" }; const payload = { mode: "persistent" };
const x = cfg.session.threadBindings?.enabled; const x = cfg.session.threadBindings?.enabled;
`; `;
expect(findChannelAgnosticBoundaryViolations(source)).toEqual([]); expect(findChannelAgnosticBoundaryViolations(source)).toStrictEqual([]);
}); });
it("reverse-deps mode flags channel module re-exports", () => { it("reverse-deps mode flags channel module re-exports", () => {
@@ -84,7 +84,7 @@ describe("check-channel-agnostic-boundaries", () => {
const channel = "discord"; const channel = "discord";
const x = cfg.channels.discord?.threadBindings?.enabled; const x = cfg.channels.discord?.threadBindings?.enabled;
`; `;
expect(findChannelCoreReverseDependencyViolations(source)).toEqual([]); expect(findChannelCoreReverseDependencyViolations(source)).toStrictEqual([]);
}); });
it("user-facing text mode flags channel names in string literals", () => { it("user-facing text mode flags channel names in string literals", () => {
@@ -103,7 +103,7 @@ describe("check-channel-agnostic-boundaries", () => {
const source = ` const source = `
import { x } from "../discord/monitor/thread-bindings.js"; import { x } from "../discord/monitor/thread-bindings.js";
`; `;
expect(findAcpUserFacingChannelNameViolations(source)).toEqual([]); expect(findAcpUserFacingChannelNameViolations(source)).toStrictEqual([]);
}); });
it("system-mark guard flags hardcoded gear literals", () => { it("system-mark guard flags hardcoded gear literals", () => {
@@ -122,6 +122,6 @@ describe("check-channel-agnostic-boundaries", () => {
const source = ` const source = `
import { x } from "../infra/system-message.js"; import { x } from "../infra/system-message.js";
`; `;
expect(findSystemMarkLiteralViolations(source)).toEqual([]); expect(findSystemMarkLiteralViolations(source)).toStrictEqual([]);
}); });
}); });

View File

@@ -26,6 +26,6 @@ describe("check-extension-wildcard-reexports", () => {
'export * from "external-package";', 'export * from "external-package";',
].join("\n"), ].join("\n"),
), ),
).toEqual([]); ).toStrictEqual([]);
}); });
}); });

View File

@@ -26,6 +26,6 @@ describe("check-plugin-sdk-wildcard-reexports", () => {
'export * from "./src/runtime-api.js";', 'export * from "./src/runtime-api.js";',
].join("\n"), ].join("\n"),
), ),
).toEqual([]); ).toStrictEqual([]);
}); });
}); });

View File

@@ -31,7 +31,7 @@ describe("install.sh", () => {
const rawAptInstalls = script const rawAptInstalls = script
.split("\n") .split("\n")
.filter((line) => /\b(?:sudo\s+)?apt-get\s+install\b/.test(line)); .filter((line) => /\b(?:sudo\s+)?apt-get\s+install\b/.test(line));
expect(rawAptInstalls).toEqual([]); expect(rawAptInstalls).toStrictEqual([]);
}); });
it("exports noninteractive apt env during Linux startup", () => { it("exports noninteractive apt env during Linux startup", () => {

View File

@@ -576,7 +576,7 @@ describe("bundled plugin postinstall", () => {
log: { log: vi.fn(), warn }, log: { log: vi.fn(), warn },
homedir: () => "/home/alice", homedir: () => "/home/alice",
}), }),
).toEqual([]); ).toStrictEqual([]);
expect(warn).toHaveBeenCalledWith( expect(warn).toHaveBeenCalledWith(
expect.stringContaining( expect.stringContaining(

View File

@@ -69,7 +69,7 @@ describe("verify-docker-attestations", () => {
inspectAttestation: () => createAttestation(), inspectAttestation: () => createAttestation(),
}); });
expect(errors).toEqual([]); expect(errors).toStrictEqual([]);
}); });
it("accepts attestation manifests with omitted artifactType", () => { it("accepts attestation manifests with omitted artifactType", () => {
@@ -84,7 +84,7 @@ describe("verify-docker-attestations", () => {
}, },
}); });
expect(errors).toEqual([]); expect(errors).toStrictEqual([]);
}); });
it("reports unexpected attestation artifact types", () => { it("reports unexpected attestation artifact types", () => {