b64.spec.js 433 B

123456789101112131415
  1. import { TextDecoder } from "util"
  2. import { decodeB64StringToArrayBuffer } from "../b64"
  3. describe("decodeB64StringToArrayBuffer", () => {
  4. test("decodes content correctly", () => {
  5. const decoder = new TextDecoder("utf-8")
  6. expect(
  7. decoder.decode(
  8. decodeB64StringToArrayBuffer("aG9wcHNjb3RjaCBpcyBhd2Vzb21lIQ==")
  9. )
  10. ).toMatch("hoppscotch is awesome!")
  11. })
  12. // TODO : More tests for binary data ?
  13. })