index.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. /// <reference types="node" />
  8. import { Script } from 'vm';
  9. import { Global, Config } from '@jest/types';
  10. import { ModuleMocker } from 'jest-mock';
  11. import { JestFakeTimers as FakeTimers } from '@jest/fake-timers';
  12. import { JestEnvironment, EnvironmentContext } from '@jest/environment';
  13. import { JSDOM } from 'jsdom';
  14. declare type Win = Window & Global.Global & {
  15. Error: {
  16. stackTraceLimit: number;
  17. };
  18. };
  19. declare class JSDOMEnvironment implements JestEnvironment {
  20. dom: JSDOM | null;
  21. fakeTimers: FakeTimers<number> | null;
  22. global: Win;
  23. errorEventListener: ((event: Event & {
  24. error: Error;
  25. }) => void) | null;
  26. moduleMocker: ModuleMocker | null;
  27. constructor(config: Config.ProjectConfig, options?: EnvironmentContext);
  28. setup(): Promise<void>;
  29. teardown(): Promise<void>;
  30. runScript(script: Script): any;
  31. }
  32. export = JSDOMEnvironment;
  33. //# sourceMappingURL=index.d.ts.map