Skip to content

Commit

Permalink
feat: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ganchoradkov committed Oct 9, 2024
1 parent b758b2a commit 70cee4c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/core/test/relayer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,21 @@ describe("Relayer", () => {
);
});

it("should throw when subscribe publish fails", async () => {
await relayer.transportOpen();
await relayer.toEstablishConnection();
relayer.subscriber.subscribeTimeout = 5_000;
relayer.request = () => {
return new Promise<void>((resolve) => {
resolve();
});
};
const topic = generateRandomBytes32();
await expect(relayer.subscribe(topic)).rejects.toThrow(
`Subscribing to ${topic} failed, please try again`,
);
});

it("should be able to resubscribe on topic that already exists", async () => {
const topic = generateRandomBytes32();
const id = await relayer.subscribe(topic);
Expand Down

0 comments on commit 70cee4c

Please sign in to comment.