From 9fe10fd9a250b569cfd2fe4be48f9ed4f0229471 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Tue, 18 Aug 2020 14:01:04 -0400 Subject: [PATCH] Added test spec for helpers/utils/b64.js --- helpers/utils/__tests__/b64.spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 helpers/utils/__tests__/b64.spec.js diff --git a/helpers/utils/__tests__/b64.spec.js b/helpers/utils/__tests__/b64.spec.js new file mode 100644 index 000000000..fc75d5bd3 --- /dev/null +++ b/helpers/utils/__tests__/b64.spec.js @@ -0,0 +1,13 @@ +import { TextDecoder } from "util" +import { decodeB64StringToArrayBuffer } from "../b64" + +describe("decodeB64StringToArrayBuffer", () => { + test("decodes content correctly", () => { + const decoder = new TextDecoder("utf-8") + expect( + decoder.decode(decodeB64StringToArrayBuffer("aG9wcHNjb3RjaCBpcyBhd2Vzb21lIQ==")) + ).toMatch("hoppscotch is awesome!") + }) + + // TODO : More tests for binary data ? +})