Skip to content

Commit

Permalink
Polyfill test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasBoll committed Oct 11, 2024
1 parent cfc632b commit b4526be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jest/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '@testing-library/jest-dom/extend-expect';
import {verifyComponent} from './verifyComponent';
import {jest} from '@jest/globals';
import {ResizeObserver} from '@juggle/resize-observer';

import {setUniqueSeed, resetUniqueIdCount} from '@workday/canvas-kit-react/common';
import {TextEncoder} from 'util';
Expand All @@ -16,4 +17,7 @@ import {TextEncoder} from 'util';
beforeEach(() => {
setUniqueSeed('a');
resetUniqueIdCount();

// jsdom doesn't have a ResizeObserver. Use a polyfill: https://github.com/jsdom/jsdom/issues/3368
global.ResizeObserver = ResizeObserver;
});

0 comments on commit b4526be

Please sign in to comment.