npm.io
1.0.1 • Published 3 years ago

jest-async-fn

Licence
ISC
Version
1.0.1
Deps
0
Size
2 kB
Vulns
0
Weekly
0

jest-async-fn

test: passed license: ISC

Usage

import { createAsyncFn } from "jest-async-fn";

it("test", async () => {
    const [resolved, callback] = createAsyncFn();

    someAsyncFunctionWithCallback(callback);

    await resolved;

    expect(callback).toHaveBeenCalled();
});

Keywords