Skip to content

Commit

Permalink
test(middleware-flexible-checksums): update selectAlgo unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Nov 8, 2024
1 parent 6a48760 commit bbc769a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { AwsCrc32 } from "@aws-crypto/crc32";
import { AwsCrc32c } from "@aws-crypto/crc32c";
import { describe, expect, test as it, vi } from "vitest";

import { ChecksumAlgorithm } from "./constants";
import { getCrc32ChecksumAlgorithmFunction } from "./getCrc32ChecksumAlgorithmFunction";
import { selectChecksumAlgorithmFunction } from "./selectChecksumAlgorithmFunction";

describe(selectChecksumAlgorithmFunction.name, () => {
const mockConfig = {
md5: vi.fn(),
sha1: vi.fn(),
sha256: vi.fn(),
crc32: getCrc32ChecksumAlgorithmFunction(),
};

it.each([
[ChecksumAlgorithm.MD5, mockConfig.md5],
[ChecksumAlgorithm.CRC32, AwsCrc32],
[ChecksumAlgorithm.CRC32, getCrc32ChecksumAlgorithmFunction()],
[ChecksumAlgorithm.CRC32C, AwsCrc32c],
[ChecksumAlgorithm.SHA1, mockConfig.sha1],
[ChecksumAlgorithm.SHA256, mockConfig.sha256],
Expand Down

0 comments on commit bbc769a

Please sign in to comment.