useRealTimers in onCssReady test case

This commit is contained in:
Abhishek Jakhar
2020-10-21 15:43:02 +05:30
parent d7594eb698
commit 53f9d70658
@@ -25,14 +25,20 @@ import { onCssReady } from '../transformers';
const docStorageUrl: string =
'https://techdocs-mock-sites.storage.googleapis.com';
jest.useFakeTimers();
const fixture = `
<link rel="stylesheet" href="${docStorageUrl}/test.css" />
<link rel="stylesheet" href="http://example.com/test.css" />
`;
describe('onCssReady', () => {
beforeAll(() => {
jest.useFakeTimers();
});
afterAll(() => {
jest.useRealTimers();
});
beforeEach(() => {
mockStylesheetEventListener(100);
});