@stripe/connect-js
Version:
Connect.js loading utility package
18 lines (15 loc) • 435 B
text/typescript
import { SCRIPT_SELECTOR } from "./jestHelpers";
global.beforeEach(() => {
jest.spyOn(console, "warn").mockReturnValue();
jest.useFakeTimers();
});
global.afterEach(() => {
const script = document.querySelector(SCRIPT_SELECTOR);
if (script && script.parentElement) {
script.parentElement.removeChild(script);
}
jest.resetModules();
jest.restoreAllMocks();
jest.runOnlyPendingTimers();
jest.useRealTimers();
});