Merge pull request #17614 from storybookjs/jest-mock-global-this

Addon-interactions: Use 'global' package instead of `global`
This commit is contained in:
Yann Braga 2022-03-02 15:31:13 -08:00 committed by GitHub
commit 761501bf13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,12 @@
import { Args, addons } from '@storybook/addons';
import { addons } from '@storybook/addons';
import type { Args } from '@storybook/addons';
import { window as globalWindow } from 'global';
import { FORCE_REMOUNT, STORY_RENDER_PHASE_CHANGED } from '@storybook/core-events';
import { AnyFramework, ArgsEnhancer } from '@storybook/csf';
import { instrument } from '@storybook/instrumenter';
import { ModuleMocker } from 'jest-mock';
const JestMock = new ModuleMocker(global);
const JestMock = new ModuleMocker(globalWindow);
const fn = JestMock.fn.bind(JestMock);
// Aliasing `fn` to `action` here, so we get a more descriptive label in the UI.