woocommerce/plugins/woo-ai/tests/js/jest-setup.js

20 lines
323 B
JavaScript
Raw Normal View History

/**
* External dependencies
*/
import '@testing-library/jest-dom';
beforeEach( () => {
// Mock fetch
global.fetch = jest.fn( () =>
Promise.resolve( {
json: () => Promise.resolve( {} ),
} )
);
} );
afterEach( () => {
jest.clearAllTimers();
} );
global.ResizeObserver = require( 'resize-observer-polyfill' );