Skip to content

Commit

Permalink
test: add test cases for encode64
Browse files Browse the repository at this point in the history
  • Loading branch information
mogeko committed Oct 6, 2024
1 parent 5111733 commit 2c18524
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/encoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import { encode, encode64 } from "@/encoder";
import { expect, it } from "vitest";

it("encode64", () => {
expect(encode64(Uint8Array.of(75, 76, 74, 6, 0))).toStrictEqual(
Uint8Array.of(73, 113, 110, 65, 49, 87, 48, 48),
expect(encode64(Uint8Array.of(1, 2, 3))).toStrictEqual(
Uint8Array.of(48, 71, 56, 51),
);
expect(encode64(Uint8Array.of(1, 2))).toStrictEqual(
Uint8Array.of(48, 71, 56, 48),
);
expect(encode64(Uint8Array.of(1))).toStrictEqual(
Uint8Array.of(48, 71, 48, 48),
);
});

Expand Down

0 comments on commit 2c18524

Please sign in to comment.