Remove ResizeObserver Polyfill (#7844)

This commit is contained in:
Michael Telatynski 2022-02-18 13:51:27 +00:00 committed by GitHub
parent 29c1c8d1e1
commit 38a547b5d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 21 deletions

View file

@ -13,6 +13,14 @@ require('jest-fetch-mock').enableMocks();
// polyfill until setImmediate use in client can be removed
global.setImmediate = callback => setTimeout(callback, 0);
// Stub ResizeObserver
class ResizeObserver {
observe() {} // do nothing
unobserve() {} // do nothing
disconnect() {} // do nothing
}
window.ResizeObserver = ResizeObserver;
// polyfilling TextEncoder as it is not available on JSDOM
// view https://github.com/facebook/jest/issues/9983
global.TextEncoder = TextEncoder;