diff --git a/jest.setup.ts b/jest.setup.ts index 3aeec7e36..8d0dea0b9 100644 --- a/jest.setup.ts +++ b/jest.setup.ts @@ -50,6 +50,12 @@ Object.defineProperty(window, 'ResizeObserver', { }, }); +Object.defineProperty(window, 'IntersectionObserver', { + value: function () { + return TestUtils.createMockProxy(); + }, +}); + Object.defineProperty(window, 'DOMRect', { value: function (x: number = 0, y: number = 0, width = 0, height = 0) { return TestUtils.createMockProxy({ diff --git a/packages/console/src/Console.tsx b/packages/console/src/Console.tsx index 647308d02..b94bc78ff 100644 --- a/packages/console/src/Console.tsx +++ b/packages/console/src/Console.tsx @@ -215,7 +215,7 @@ export class Console extends PureComponent { this.consoleHistoryScrollPane = React.createRef(); this.pending = new Pending(); this.queuedLogMessages = []; - this.visibilityObserver = new IntersectionObserver( + this.visibilityObserver = new window.IntersectionObserver( this.handleVisibilityChange );