1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { Context } from 'vm';
|
9 | import type { JestEnvironment } from '@jest/environment';
|
10 | import { LegacyFakeTimers, ModernFakeTimers } from '@jest/fake-timers';
|
11 | import type { Config, Global } from '@jest/types';
|
12 | import { ModuleMocker } from 'jest-mock';
|
13 | declare type Timer = {
|
14 | id: number;
|
15 | ref: () => Timer;
|
16 | unref: () => Timer;
|
17 | };
|
18 | declare class NodeEnvironment implements JestEnvironment<Timer> {
|
19 | context: Context | null;
|
20 | fakeTimers: LegacyFakeTimers<Timer> | null;
|
21 | fakeTimersModern: ModernFakeTimers | null;
|
22 | global: Global.Global;
|
23 | moduleMocker: ModuleMocker | null;
|
24 | constructor(config: Config.ProjectConfig);
|
25 | setup(): Promise<void>;
|
26 | teardown(): Promise<void>;
|
27 | getVmContext(): Context | null;
|
28 | }
|
29 | export = NodeEnvironment;
|