Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Gruenfelder committed Jan 9, 2025
1 parent 6f94728 commit 558beed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/redisPubSub.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const path = require("path");

const setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((_, fn) => {
fn();
const setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((first, second) => {
(first instanceof Function ? first : second)();
});

const distributedLock = require("../src/shared/distributedLock");
Expand Down Expand Up @@ -72,7 +72,10 @@ describe("eventQueue Redis Events and DB Handlers", () => {
jest.clearAllMocks();
});

afterAll(() => cds.shutdown);
afterAll(async () => {
cds._events.shutdown.pop();
await cds.shutdown;
});

describe("publish", () => {
test("should not be called if not activated for the event", async () => {
Expand Down

0 comments on commit 558beed

Please sign in to comment.