/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
test/packages/setup.js
25 строк
847 B
arthur791004
Bump @wordpress/dataviews to 17.2.0 (with editor, components, private-apis, theme, ui) (#112947)
27 июл 2026, 08:23
Не верифицирован
27 июл 2026, 08:23
c2c1a85
Код
Авторство
О чём код?
import '@testing-library/jest-dom'; import { TextEncoder, TextDecoder } from 'util'; global.crypto.randomUUID = () => 'fake-uuid'; // Polyfill for TextEncoder/TextDecoder required by superagent 10.x and its dependencies global.TextEncoder = TextEncoder; global.TextDecoder = TextDecoder; global.ResizeObserver = require( 'resize-observer-polyfill' ); // JSDOM implements `CSS.escape` but not `CSS.supports`, which Ariakit calls for // feature detection. Report everything as unsupported so it takes its fallbacks. global.CSS = { ...global.CSS, supports: () => false }; global.matchMedia = jest.fn( ( query ) => ( { matches: false, media: query, onchange: null, addListener: jest.fn(), // deprecated removeListener: jest.fn(), // deprecated addEventListener: jest.fn(), removeEventListener: jest.fn(), dispatchEvent: jest.fn(), } ) );