@kilterset/auth0-actions-testing
Version:
Test and develop Auth0 Actions or Okta CIC Actions locally.
10 lines (8 loc) • 329 B
text/typescript
import { TestContext } from "./test-context";
import { polyfillFetch } from "./polyfill-fetch";
export async function configureFetchMock(testContext: TestContext) {
await polyfillFetch(testContext);
const { default: fetchMock } = await import("fetch-mock");
testContext.afterEach(fetchMock.restore);
return fetchMock;
}