mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-19 08:22:53 +00:00
13 lines
382 B
JavaScript
13 lines
382 B
JavaScript
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,
|
|
)
|
|
})
|
|
})
|