UNPKG

491 BJavaScriptView Raw
1// @flow
2const consoleError = console.error;
3
4beforeEach(() => {
5 // Suppress errors from JSDOM CSS parser
6 // See: https://github.com/jsdom/jsdom/issues/2177
7 // eslint-disable-next-line flowtype-errors/show-errors
8 (console: any).error = message => {
9 if (!message.includes('Error: Could not parse CSS stylesheet')) {
10 consoleError(message);
11 }
12 };
13});
14
15afterEach(() => {
16 // eslint-disable-next-line flowtype-errors/show-errors
17 (console: any).error = consoleError;
18});