Skip to content

Commit

Permalink
Revert "api: Fix tests (they were broken before!)"
Browse files Browse the repository at this point in the history
This reverts commit 22e0160.
  • Loading branch information
victorges committed Apr 25, 2024
1 parent 3885b68 commit 007bbc1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/api/src/webhooks/cannon.test.ts
Expand Up @@ -286,8 +286,7 @@ describe("webhook cannon", () => {
expect(callCount).toBe(1);
expect(receivedEvent).toBe("stream.started");

// at this point the semaphore is re-acquired cause we just waited (acquired) above

sem = semaphore();
await server.queue.publishWebhook("events.stream.idle", {
type: "webhook_event",
id: "webhook_test_42",
Expand All @@ -302,6 +301,7 @@ describe("webhook cannon", () => {
expect(receivedEvent).toBe("stream.idle");

// does not receive some random event
sem = semaphore();
await server.queue.publishWebhook("events.stream.unknown" as any, {
type: "webhook_event",
id: "webhook_test_93",
Expand All @@ -311,8 +311,7 @@ describe("webhook cannon", () => {
userId: nonAdminUser.id,
});

const err = await sem.wait(1000).catch((err) => err);
expect(err?.message).toBe("timeout");
await sem.wait(1000);
expect(callCount).toBe(2);
});

Expand Down

0 comments on commit 007bbc1

Please sign in to comment.