Added test spec for helpers/utils/b64.js
This commit is contained in:
parent
6b444d280a
commit
9fe10fd9a2
1 changed files with 13 additions and 0 deletions
13
helpers/utils/__tests__/b64.spec.js
Normal file
13
helpers/utils/__tests__/b64.spec.js
Normal file
|
|
@ -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 ?
|
||||
})
|
||||
Loading…
Reference in a new issue