Move files

This commit is contained in:
Andras Schmelczer 2025-02-19 20:47:52 +00:00
parent 6bb051460e
commit dd6f63f357
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
50 changed files with 72 additions and 78 deletions

View file

@ -0,0 +1,18 @@
import init, { base64ToBytes } from "sync_lib";
import fs from "fs";
describe("deserialize", () => {
it("should serialize a Uint8Array to a base64 string", async () => {
const wasmBin = fs.readFileSync(
"../../backend/sync_lib/pkg/sync_lib_bg.wasm"
);
await init({ module_or_path: wasmBin });
const base64 = "SGVsbG8=";
const jsResult = base64ToBytes(base64);
const expected = new Uint8Array([72, 101, 108, 108, 111]);
expect(jsResult).toEqual(expected);
const rustResult = base64ToBytes(base64);
expect(jsResult).toEqual(rustResult);
});
});