test: mock matchMedia configurable (#38034)

pull/38032/head^2
MadCcc 2 years ago committed by GitHub
parent 2ef701be75
commit 92a32998ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,6 +15,8 @@ if (typeof window !== 'undefined') {
// ref: https://github.com/ant-design/ant-design/issues/18774
if (!window.matchMedia) {
Object.defineProperty(global.window, 'matchMedia', {
writable: true,
configurable: true,
value: jest.fn(query => ({
matches: query.includes('max-width'),
addListener: jest.fn(),

Loading…
Cancel
Save