From 8ef1439ca3d7d1c391c3e9885c4e6d420487ffb7 Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Wed, 8 Jul 2026 11:06:08 -0400 Subject: [PATCH] test: drop as any from patchloomNeedsUpgrade unit tests Use typed minimal PatchloomStatus objects so tests exercise real fields instead of bypassing TypeScript with casts. Signed-off-by: Sebastien Tardif --- test/unit/binary.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/unit/binary.test.ts b/test/unit/binary.test.ts index 5dd1f71..3f7b7ad 100644 --- a/test/unit/binary.test.ts +++ b/test/unit/binary.test.ts @@ -753,10 +753,11 @@ test("describePatchloomCompatibility maps all compatibility levels to labels", ( // --- patchloomNeedsUpgrade tests --- test("patchloomNeedsUpgrade returns true only for unsupported compatibility", () => { - assert.equal(patchloomNeedsUpgrade({ compatibility: "unsupported" } as any), true); - assert.equal(patchloomNeedsUpgrade({ compatibility: "supported" } as any), false); - assert.equal(patchloomNeedsUpgrade({ compatibility: "unknown" } as any), false); - assert.equal(patchloomNeedsUpgrade({ compatibility: undefined } as any), false); + const base = { ready: false, source: "missing" as const, message: "test" }; + assert.equal(patchloomNeedsUpgrade({ ...base, compatibility: "unsupported" }), true); + assert.equal(patchloomNeedsUpgrade({ ...base, compatibility: "supported" }), false); + assert.equal(patchloomNeedsUpgrade({ ...base, compatibility: "unknown" }), false); + assert.equal(patchloomNeedsUpgrade({ ...base, compatibility: undefined }), false); }); // --- isTrustedManagedInstallDownloadUrl tests ---