mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-18 07:52:50 +00:00
15 lines
410 B
TypeScript
15 lines
410 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { fromBase64, toBase64 } from "./base64";
|
|
|
|
describe("base64", function () {
|
|
const data = new Uint8Array([24, 235, 22, 67, 84, 73, 23, 77, 21]);
|
|
|
|
it("should convert back-forth", async function () {
|
|
expect(
|
|
await fromBase64(await toBase64(new Blob([data]))).then((it) =>
|
|
it.arrayBuffer(),
|
|
),
|
|
).toEqual(data.buffer);
|
|
});
|
|
});
|