+4
-3
@@ -15,13 +15,14 @@ test('b642a and a2b64 are reciprocal', () => {
|
||||
const from_str = "Testing value !"
|
||||
const from = btoa(from_str)
|
||||
|
||||
let buff = b642a(from).expect("Should encode valid b64")
|
||||
let to = a2b64(buff)
|
||||
let buff = b642a(from)
|
||||
expect(buff).not.toBeNull()
|
||||
let to = a2b64(buff!)
|
||||
|
||||
expect(to).toBe(from)
|
||||
})
|
||||
|
||||
|
||||
test("b642a doesn't accept invalid b64", () => {
|
||||
b642a("pa'0ac'i !!").expect_err("Shouldn't unpack invalid b64")
|
||||
expect(b642a("pa'0ac'i !!")).toBeNull()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user