From 5206f401048fb42d216a5908e729ebe3206f17ab Mon Sep 17 00:00:00 2001 From: Shakker Date: Sat, 9 May 2026 04:50:32 +0100 Subject: [PATCH] test: tighten release empty array assertions --- test/official-channel-catalog.test.ts | 2 +- test/openclaw-npm-postpublish-verify.test.ts | 10 +++++----- test/openclaw-npm-release-check.test.ts | 16 ++++++++-------- test/openclaw-prepack.test.ts | 2 +- test/plugin-clawhub-release.test.ts | 10 +++++----- test/plugin-npm-release.test.ts | 14 +++++++------- test/release-check.test.ts | 12 ++++++------ 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/test/official-channel-catalog.test.ts b/test/official-channel-catalog.test.ts index a538ee2114a..6f0db1346f9 100644 --- a/test/official-channel-catalog.test.ts +++ b/test/official-channel-catalog.test.ts @@ -162,7 +162,7 @@ describe("buildOfficialChannelCatalog", () => { expect(entries.length).toBeGreaterThan(0); for (const entry of entries) { const installSource = describePluginInstallSource(requireInstall(entry)); - expect(installSource.warnings).toEqual([]); + expect(installSource.warnings).toStrictEqual([]); expect(requireNpmInstallSource(installSource).pinState).toBe("exact-with-integrity"); } }); diff --git a/test/openclaw-npm-postpublish-verify.test.ts b/test/openclaw-npm-postpublish-verify.test.ts index 9ad7a03141c..e2d6dadd460 100644 --- a/test/openclaw-npm-postpublish-verify.test.ts +++ b/test/openclaw-npm-postpublish-verify.test.ts @@ -139,7 +139,7 @@ describe("collectInstalledContextEngineRuntimeErrors", () => { "utf8", ); - expect(collectInstalledContextEngineRuntimeErrors(packageRoot)).toEqual([]); + expect(collectInstalledContextEngineRuntimeErrors(packageRoot)).toStrictEqual([]); } finally { rmSync(packageRoot, { recursive: true, force: true }); } @@ -220,7 +220,7 @@ describe("collectInstalledRootDependencyManifestErrors", () => { "utf8", ); - expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toEqual([]); + expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toStrictEqual([]); } finally { rmSync(packageRoot, { recursive: true, force: true }); } @@ -246,7 +246,7 @@ describe("collectInstalledRootDependencyManifestErrors", () => { "utf8", ); - expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toEqual([]); + expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toStrictEqual([]); } finally { rmSync(packageRoot, { recursive: true, force: true }); } @@ -301,7 +301,7 @@ describe("collectInstalledRootDependencyManifestErrors", () => { "utf8", ); - expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toEqual([]); + expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toStrictEqual([]); } finally { rmSync(packageRoot, { recursive: true, force: true }); } @@ -326,7 +326,7 @@ describe("collectInstalledRootDependencyManifestErrors", () => { "utf8", ); - expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toEqual([]); + expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toStrictEqual([]); } finally { rmSync(packageRoot, { recursive: true, force: true }); } diff --git a/test/openclaw-npm-release-check.test.ts b/test/openclaw-npm-release-check.test.ts index 5d4b3117f6f..5981489acd0 100644 --- a/test/openclaw-npm-release-check.test.ts +++ b/test/openclaw-npm-release-check.test.ts @@ -352,7 +352,7 @@ describe("collectControlUiPackErrors", () => { "dist/control-ui/assets/index-Bu8rSoJV.js", "dist/control-ui/assets/index-BK0yXA_h.css", ]), - ).toEqual([]); + ).toStrictEqual([]); }); }); @@ -486,7 +486,7 @@ describe("collectPackedTestCargoErrors", () => { "dist/extensions/whatsapp/node_modules/pino/lib/proto.js", "dist/extensions/webhooks/node_modules/zod/v4/core/api.js", ]), - ).toEqual([]); + ).toStrictEqual([]); }); it("allows legitimate package roots named test under node_modules", () => { @@ -495,7 +495,7 @@ describe("collectPackedTestCargoErrors", () => { "dist/extensions/fixture-plugin/node_modules/direct/node_modules/test/index.js", "dist/extensions/fixture-plugin/node_modules/direct/node_modules/@scope/tests/index.js", ]), - ).toEqual([]); + ).toStrictEqual([]); }); it("allows leaf runtime filenames named test or tests", () => { @@ -504,7 +504,7 @@ describe("collectPackedTestCargoErrors", () => { "dist/extensions/fixture-plugin/node_modules/direct/bin/test", "dist/extensions/fixture-plugin/node_modules/direct/bin/tests", ]), - ).toEqual([]); + ).toStrictEqual([]); }); it("normalizes Windows or mixed separators before classifying test cargo", () => { @@ -529,7 +529,7 @@ describe("collectReleaseTagErrors", () => { releaseTag: "v2026.3.10", now: new Date("2026-03-11T12:00:00Z"), }), - ).toEqual([]); + ).toStrictEqual([]); }); it("rejects versions outside the two-day CalVer window", () => { @@ -549,7 +549,7 @@ describe("collectReleaseTagErrors", () => { releaseTag: "v2026.3.10-1", now: new Date("2026-03-10T00:00:00Z"), }), - ).toEqual([]); + ).toStrictEqual([]); }); it("accepts correction package versions paired with matching correction tags", () => { @@ -559,7 +559,7 @@ describe("collectReleaseTagErrors", () => { releaseTag: "v2026.3.10-1", now: new Date("2026-03-10T00:00:00Z"), }), - ).toEqual([]); + ).toStrictEqual([]); }); it("rejects beta package versions paired with fallback correction tags", () => { @@ -583,7 +583,7 @@ describe("collectReleasePackageMetadataErrors", () => { repository: { url: "git+https://github.com/openclaw/openclaw.git" }, bin: { openclaw: "openclaw.mjs" }, }), - ).toEqual([]); + ).toStrictEqual([]); }); it("rejects node-llama-cpp as a peer dependency", () => { diff --git a/test/openclaw-prepack.test.ts b/test/openclaw-prepack.test.ts index a47b36ea5e9..b9243fe0a53 100644 --- a/test/openclaw-prepack.test.ts +++ b/test/openclaw-prepack.test.ts @@ -8,7 +8,7 @@ describe("collectPreparedPrepackErrors", () => { ["dist/index.mjs", "dist/control-ui/index.html"], ["dist/control-ui/assets/index-Bu8rSoJV.js"], ), - ).toEqual([]); + ).toStrictEqual([]); }); it("reports missing build and control ui artifacts", () => { diff --git a/test/plugin-clawhub-release.test.ts b/test/plugin-clawhub-release.test.ts index 18d8eb9dd3a..5bfba936e19 100644 --- a/test/plugin-clawhub-release.test.ts +++ b/test/plugin-clawhub-release.test.ts @@ -50,7 +50,7 @@ describe("resolveChangedClawHubPublishablePluginPackages", () => { plugins: publishablePlugins, changedPaths: ["pnpm-lock.yaml"], }), - ).toEqual([]); + ).toStrictEqual([]); }); }); @@ -245,7 +245,7 @@ describe("collectClawHubVersionGateErrors", () => { gitRange: { baseRef, headRef }, }); - expect(errors).toEqual([]); + expect(errors).toStrictEqual([]); }); it("does not require a version bump for shared release-tooling changes", () => { @@ -258,7 +258,7 @@ describe("collectClawHubVersionGateErrors", () => { gitRange: { baseRef, headRef }, }); - expect(errors).toEqual([]); + expect(errors).toStrictEqual([]); }); }); @@ -322,7 +322,7 @@ describe("collectPluginClawHubReleasePlan", () => { registryBaseUrl: "https://clawhub.ai", }); - expect(plan.candidates).toEqual([]); + expect(plan.candidates).toStrictEqual([]); expect(plan.skippedPublished).toHaveLength(1); expect(plan.skippedPublished[0]).toMatchObject({ packageName: "@openclaw/demo-plugin", @@ -403,7 +403,7 @@ describe("collectClawHubOpenClawOwnerErrors", () => { }), }); - expect(errors).toEqual([]); + expect(errors).toStrictEqual([]); }); }); diff --git a/test/plugin-npm-release.test.ts b/test/plugin-npm-release.test.ts index 90fe482d3bb..946626c63f0 100644 --- a/test/plugin-npm-release.test.ts +++ b/test/plugin-npm-release.test.ts @@ -25,9 +25,9 @@ afterEach(() => { describe("parsePluginReleaseSelection", () => { it("returns an empty list for blank input", () => { - expect(parsePluginReleaseSelection("")).toEqual([]); - expect(parsePluginReleaseSelection(" ")).toEqual([]); - expect(parsePluginReleaseSelection(undefined)).toEqual([]); + expect(parsePluginReleaseSelection("")).toStrictEqual([]); + expect(parsePluginReleaseSelection(" ")).toStrictEqual([]); + expect(parsePluginReleaseSelection(undefined)).toStrictEqual([]); }); it("dedupes and sorts comma or whitespace separated package names", () => { @@ -107,7 +107,7 @@ describe("collectPublishablePluginPackageErrors", () => { }, }, }), - ).toEqual([]); + ).toStrictEqual([]); }); it("flags invalid publishable plugin metadata", () => { @@ -207,7 +207,7 @@ describe("collectPublishablePluginPackages", () => { ), ).filter((entry) => !packageFiles.has(entry)); - expect(missingExclusions).toEqual([]); + expect(missingExclusions).toStrictEqual([]); }); it("collects publishable npm plugins from extension package manifests", () => { @@ -312,7 +312,7 @@ describe("collectPublishablePluginPackages", () => { collectPublishablePluginPackages(repoDir, { extensionIds: [], }), - ).toEqual([]); + ).toStrictEqual([]); }); it("publishes alpha plugin packages to the alpha dist-tag", () => { @@ -443,6 +443,6 @@ describe("resolveChangedPublishablePluginPackages", () => { plugins: publishablePlugins, changedExtensionIds: [], }), - ).toEqual([]); + ).toStrictEqual([]); }); }); diff --git a/test/release-check.test.ts b/test/release-check.test.ts index e4cdf4b05f4..f9d269fadfa 100644 --- a/test/release-check.test.ts +++ b/test/release-check.test.ts @@ -49,7 +49,7 @@ describe("collectAppcastSparkleVersionErrors", () => { it("accepts legacy 9-digit calver builds before lane-floor cutover", () => { const xml = `${makeItem("2026.2.26", "202602260")}`; - expect(collectAppcastSparkleVersionErrors(xml)).toEqual([]); + expect(collectAppcastSparkleVersionErrors(xml)).toStrictEqual([]); }); it("requires lane-floor builds on and after lane-floor cutover", () => { @@ -63,7 +63,7 @@ describe("collectAppcastSparkleVersionErrors", () => { it("accepts canonical stable lane builds on and after lane-floor cutover", () => { const xml = `${makeItem("2026.3.1", "2026030190")}`; - expect(collectAppcastSparkleVersionErrors(xml)).toEqual([]); + expect(collectAppcastSparkleVersionErrors(xml)).toStrictEqual([]); }); }); @@ -237,7 +237,7 @@ describe("collectBundledExtensionManifestErrors", () => { }, }, ]), - ).toEqual([]); + ).toStrictEqual([]); }); it("flags non-object install metadata instead of throwing", () => { @@ -301,7 +301,7 @@ describe("bundled plugin package dependency checks", () => { "utf8", ); - expect(collectInstalledRootDependencyManifestErrors(tempRoot)).toEqual([]); + expect(collectInstalledRootDependencyManifestErrors(tempRoot)).toStrictEqual([]); } finally { rmSync(tempRoot, { recursive: true, force: true }); } @@ -531,7 +531,7 @@ describe("collectMissingPackPaths", () => { "dist/channel-catalog.json", PACKAGE_DIST_INVENTORY_RELATIVE_PATH, ]), - ).toEqual([]); + ).toStrictEqual([]); }); it("requires bundled plugin runtime sidecars that dynamic plugin boundaries resolve at runtime", () => { @@ -574,7 +574,7 @@ describe("collectPackUnpackedSizeErrors", () => { it("accepts pack results within the unpacked size budget", () => { expect( collectPackUnpackedSizeErrors([makePackResult("openclaw-2026.3.14.tgz", 120_354_302)]), - ).toEqual([]); + ).toStrictEqual([]); }); it("flags oversized pack results that risk low-memory startup failures", () => {