Files
setup-uv/__tests__/download/checksum/checksum.test.ts
T
Kevin StillhammerandGitHub 8473c7fea4 chore(deps): roll up Dependabot updates (#994)
## Summary

Roll up the remaining net changes from the open Dependabot updates:

- release-drafter/release-drafter 7.7.0 (#990)
- github/codeql-action 4.37.4 (#987, #988, #989)
- zizmorcore/zizmor-action 0.6.1 (#986)
- @actions/cache 6.2.0 (#975)
- @biomejs/biome 2.5.4 (#974)
- undici 8.7.0 (#973)

The Jest 30.4.2 (#905) and @renovatebot/pep440 5.0.0 (#907) updates are
already present on main and require no additional changes.

This also updates the Biome schema, applies the formatter changes from
Biome 2.5.4, and regenerates the published bundles.

## Testing

- `npm run all`
- `actionlint`
- `git diff --check`

Refs: pi-session 019ff01b-f917-73c1-950e-2966956f263c
2026-08-11 11:27:16 +02:00

49 lines
1.0 KiB
TypeScript

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