Skip to content

Commit

Permalink
[core] Fix jsdom failing to parse container queries in inline styles
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed May 12, 2024
1 parent 9b2abd7 commit 4d64d50
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jsdom.mocks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import '@testing-library/jest-dom';

const { getComputedStyle } = window;
Expand Down Expand Up @@ -25,3 +26,14 @@ class ResizeObserver {
}

window.ResizeObserver = ResizeObserver;

const originalConsoleError = console.error;
console.error = (...data) => {
if (
typeof data[0]?.toString === 'function' &&
data[0].toString().includes('Error: Could not parse CSS stylesheet')
) {
return;
}
originalConsoleError(...data);
};

0 comments on commit 4d64d50

Please sign in to comment.