import { Http } from "../../commons/utils/http"; import { DummyRunner } from "./dummy-runner"; const dummyRunner = new DummyRunner(); beforeEach(() => { const post = jest.fn().mockReturnValue({ status: 204 }); post.mockClear(); (Http as any).post = post; }); test("should not do anything", async () => { window.dataLayer = []; await dummyRunner.start(); // Wait for all events to be processed. await new Promise((resolve) => setTimeout(resolve, 1000)); expect(Http.post).not.toBeCalled(); });