Do not change default version on known checksum update (#39)

This commit is contained in:
Kevin Stillhammer 2024-09-05 15:26:17 +02:00 committed by GitHub
parent bfebbf80cb
commit b3cf8231d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 34804 additions and 101 deletions

View file

@ -1,37 +0,0 @@
import { expect, test, it } from "@jest/globals";
import {
isknownVersion,
validateChecksum,
} from "../../../src/download/checksum/checksum";
test("checksum should match", async () => {
const validChecksum =
"f3da96ec7e995debee7f5d52ecd034dfb7074309a1da42f76429ecb814d813a3";
const filePath = "__tests__/fixtures/checksumfile";
// string params don't matter only test the checksum mechanism, not known checksums
await validateChecksum(
validChecksum,
filePath,
"aarch64",
"pc-windows-msvc",
"1.2.3",
);
});
type KnownVersionFixture = { version: string; known: boolean };
it.each<KnownVersionFixture>([
{
version: "0.3.0",
known: true,
},
{
version: "0.0.15",
known: false,
},
])(
"isknownVersion should return $known for version $version",
({ version, known }) => {
expect(isknownVersion(version)).toBe(known);
},
);