forked from stoplightio/elements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupTests.ts
28 lines (19 loc) · 755 Bytes
/
setupTests.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import '@testing-library/jest-dom';
import { ResizeObserver } from '@juggle/resize-observer';
import fetchMock from 'jest-fetch-mock';
const Enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-16');
Enzyme.configure({ adapter: new Adapter() });
process.env.TZ = 'UTC';
Element.prototype.scrollTo = () => {};
window.ResizeObserver = ResizeObserver;
window.IntersectionObserver = class implements IntersectionObserver {
readonly root!: Element | null;
readonly rootMargin!: string;
readonly thresholds!: ReadonlyArray<number>;
public readonly observe = jest.fn();
public readonly unobserve = jest.fn();
public readonly disconnect = jest.fn();
public readonly takeRecords = jest.fn();
};
fetchMock.enableMocks();