Skip to content

Commit e90e50e

Browse files
committed
chore: suppress jsdom CSS stylesheet parse noise in tests
1 parent eb7ddf7 commit e90e50e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/setup.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
44
import '../src';
55

66
configure({ adapter: new Adapter() });
7+
8+
// Suppress expected noise from React dev warnings and jsdom CSS parsing
9+
const originalConsoleError = console.error;
10+
console.error = (...args) => {
11+
if (typeof args[0] === 'string' && (
12+
args[0].startsWith('Warning:') ||
13+
args[0].includes('Could not parse CSS stylesheet')
14+
)) return;
15+
originalConsoleError.call(console, ...args);
16+
};

0 commit comments

Comments
 (0)