The tests work
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { binToHex } from "@bitauth/libauth";
|
||||
import { serializeInvitation } from "@xo-cash/engine";
|
||||
import { deserializeInvitation, serializeInvitation } from "@xo-cash/engine";
|
||||
import type { XOInvitation, XOInvitationCommit } from "@xo-cash/types";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@@ -135,7 +135,7 @@ describe("SyncServer v2 adapter", () => {
|
||||
invitationIdentifier,
|
||||
new Uint8Array(32).fill(1),
|
||||
);
|
||||
const messages: Array<{ event?: string; data: string }> = [];
|
||||
const messages: Array<{ event?: string; data: XOInvitation }> = [];
|
||||
sync.on("message", (message) => messages.push(message));
|
||||
|
||||
client.onMessage?.(
|
||||
@@ -149,6 +149,6 @@ describe("SyncServer v2 adapter", () => {
|
||||
|
||||
expect(messages).toHaveLength(1);
|
||||
expect(messages[0]?.event).toBe("invitation-updated");
|
||||
expect(messages[0]?.data).toBe(serializeInvitation(updated));
|
||||
expect(messages[0]?.data).toEqual(deserializeInvitation(serializeInvitation(updated)));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user