How to use the @times-components/test-utils.delayAndAdvance function in @times-components/test-utils

To help you get started, we’ve selected a few @times-components/test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newsuk / times-components / packages / tealium / __tests__ / web / scheduler.js View on Github external
it("should send multiple events", async () => {
        setup();

        const e1 = { component: "Page1" };
        const e2 = { component: "Page2" };

        sendScheduler.enqueue(e1);
        sendScheduler.enqueue(e2);

        await delayAndAdvance(1000);
        expect(global.window.tealiumTrack).toHaveBeenCalledTimes(2);
      });

@times-components/test-utils

Test helpers for Times Components

BSD-3-Clause
Latest version published 8 months ago

Package Health Score

78 / 100
Full package analysis