index.d.ts 975 B

1234567891011121314151617181920212223242526272829
  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, Context } 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 } from '@jest/environment';
  13. declare type Timer = {
  14. id: number;
  15. ref: () => Timer;
  16. unref: () => Timer;
  17. };
  18. declare class NodeEnvironment implements JestEnvironment {
  19. context: Context | null;
  20. fakeTimers: FakeTimers<Timer> | null;
  21. global: Global.Global;
  22. moduleMocker: ModuleMocker | null;
  23. constructor(config: Config.ProjectConfig);
  24. setup(): Promise<void>;
  25. teardown(): Promise<void>;
  26. runScript(script: Script): any;
  27. }
  28. export = NodeEnvironment;
  29. //# sourceMappingURL=index.d.ts.map