Skip to content

Commit

Permalink
skip test if global.gc is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed May 26, 2022
1 parent 44a7d0f commit ac6ede0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ describe('useGridApiEventHandler', () => {
it('should unsubscribe event listeners registered by uncommitted components', async function test() {
if (
!/jsdom/.test(window.navigator.userAgent) ||
typeof FinalizationRegistry === 'undefined'
typeof FinalizationRegistry === 'undefined' ||
typeof global.gc === 'undefined'
) {
// Needs ability to trigger the garbage collector and support for FinalizationRegistry (added in node 14)
this.skip();
Expand Down Expand Up @@ -50,7 +51,7 @@ describe('useGridApiEventHandler', () => {
expect(apiRef.current.subscribeEvent.callCount).to.equal(2);

unmount();
global.gc!(); // Triggers garbage collector
global.gc(); // Triggers garbage collector
await sleep(50);

// Ensure that both event listeners were unsubscribed
Expand Down

0 comments on commit ac6ede0

Please sign in to comment.