refactor: move hoppscotch-common tests to vitest (#3154)
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
import { TextDecoder } from "util"
|
||||
import { describe, expect, test } from "vitest"
|
||||
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!")
|
||||
decodeB64StringToArrayBuffer("aG9wcHNjb3RjaCBpcyBhd2Vzb21lIQ==")
|
||||
).toEqual(Buffer.from("hoppscotch is awesome!", "utf-8").buffer)
|
||||
})
|
||||
|
||||
// TODO : More tests for binary data ?
|
||||
|
||||
Reference in New Issue
Block a user