Merge pull request #3020 from abhishekjakhar/chore/onCssReady-test-case

chore: reset fake timers in onCssReady test cases
This commit is contained in:
Fredrik Adelöw
2020-10-21 16:31:53 +02:00
committed by GitHub
@@ -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);
});