Updating NPM dependencies
This commit is contained in:
62
node_modules/@jest/environment/build/index.d.ts
generated
vendored
62
node_modules/@jest/environment/build/index.d.ts
generated
vendored
@@ -5,12 +5,10 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
/// <reference types="jest" />
|
||||
import { Script } from 'vm';
|
||||
import { Circus, Config, Global } from '@jest/types';
|
||||
import jestMock, { ModuleMocker } from 'jest-mock';
|
||||
import { ScriptTransformer } from '@jest/transform';
|
||||
import { JestFakeTimers as FakeTimers } from '@jest/fake-timers';
|
||||
import type { Context, Script } from 'vm';
|
||||
import type { LegacyFakeTimers, ModernFakeTimers } from '@jest/fake-timers';
|
||||
import type { Circus, Config, Global } from '@jest/types';
|
||||
import jestMock = require('jest-mock');
|
||||
declare type JestMockFn = typeof jestMock.fn;
|
||||
declare type JestMockSpyOn = typeof jestMock.spyOn;
|
||||
export declare type EnvironmentContext = Partial<{
|
||||
@@ -18,31 +16,30 @@ export declare type EnvironmentContext = Partial<{
|
||||
docblockPragmas: Record<string, string | Array<string>>;
|
||||
testPath: Config.Path;
|
||||
}>;
|
||||
export declare type ModuleWrapper = (module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], global: Global.Global, jest: Jest, ...extraGlobals: Array<Global.Global[keyof Global.Global]>) => unknown;
|
||||
export declare type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], global: Global.Global, jest?: Jest, ...extraGlobals: Array<Global.Global[keyof Global.Global]>) => unknown;
|
||||
export declare class JestEnvironment {
|
||||
constructor(config: Config.ProjectConfig, context?: EnvironmentContext);
|
||||
global: Global.Global;
|
||||
fakeTimers: FakeTimers<unknown> | null;
|
||||
moduleMocker: ModuleMocker | null;
|
||||
runScript(script: Script): {
|
||||
[ScriptTransformer.EVAL_RESULT_VARIABLE]: ModuleWrapper;
|
||||
} | null;
|
||||
fakeTimers: LegacyFakeTimers<unknown> | null;
|
||||
fakeTimersModern: ModernFakeTimers | null;
|
||||
moduleMocker: jestMock.ModuleMocker | null;
|
||||
/**
|
||||
* @deprecated implement getVmContext instead
|
||||
*/
|
||||
runScript<T = unknown>(script: Script): T | null;
|
||||
getVmContext?(): Context | null;
|
||||
setup(): Promise<void>;
|
||||
teardown(): Promise<void>;
|
||||
handleTestEvent?(event: Circus.Event, state: Circus.State): void;
|
||||
handleTestEvent?(event: Circus.Event, state: Circus.State): void | Promise<void>;
|
||||
}
|
||||
export declare type Module = NodeModule;
|
||||
export interface LocalModuleRequire extends NodeRequire {
|
||||
requireActual(moduleName: string): unknown;
|
||||
requireMock(moduleName: string): unknown;
|
||||
}
|
||||
export interface Jest {
|
||||
/**
|
||||
* Provides a way to add Jasmine-compatible matchers into your Jest context.
|
||||
*
|
||||
* @deprecated Use `expect.extend` instead
|
||||
*/
|
||||
addMatchers(matchers: Record<string, any>): void;
|
||||
addMatchers(matchers: Record<string, unknown>): void;
|
||||
/**
|
||||
* Advances all timers by the needed milliseconds so that only the next timeouts/intervals will run.
|
||||
* Optionally, you can provide steps, so it will run steps amount of next timeouts/intervals.
|
||||
@@ -106,12 +103,22 @@ export interface Jest {
|
||||
*
|
||||
* This is useful when you want to create a manual mock that extends the
|
||||
* automatic mock's behavior.
|
||||
*
|
||||
* @deprecated Use `jest.createMockFromModule()` instead
|
||||
*/
|
||||
genMockFromModule(moduleName: string): unknown;
|
||||
/**
|
||||
* Given the name of a module, use the automatic mocking system to generate a
|
||||
* mocked version of the module for you.
|
||||
*
|
||||
* This is useful when you want to create a manual mock that extends the
|
||||
* automatic mock's behavior.
|
||||
*/
|
||||
createMockFromModule(moduleName: string): unknown;
|
||||
/**
|
||||
* Determines if the given function is a mocked function.
|
||||
*/
|
||||
isMockFunction(fn: Function): fn is ReturnType<JestMockFn>;
|
||||
isMockFunction(fn: (...args: Array<any>) => unknown): fn is ReturnType<JestMockFn>;
|
||||
/**
|
||||
* Mocks a module with an auto-mocked version when it is being required.
|
||||
*/
|
||||
@@ -177,6 +184,8 @@ export interface Jest {
|
||||
retryTimes(numRetries: number): Jest;
|
||||
/**
|
||||
* Exhausts tasks queued by setImmediate().
|
||||
*
|
||||
* > Note: This function is not available when using Lolex as fake timers implementation
|
||||
*/
|
||||
runAllImmediates(): void;
|
||||
/**
|
||||
@@ -247,7 +256,7 @@ export interface Jest {
|
||||
/**
|
||||
* Instructs Jest to use fake versions of the standard timer functions.
|
||||
*/
|
||||
useFakeTimers(): Jest;
|
||||
useFakeTimers(implementation?: 'modern' | 'legacy'): Jest;
|
||||
/**
|
||||
* Instructs Jest to use the real versions of the standard timer functions.
|
||||
*/
|
||||
@@ -259,6 +268,17 @@ export interface Jest {
|
||||
* every test so that local module state doesn't conflict between tests.
|
||||
*/
|
||||
isolateModules(fn: () => void): Jest;
|
||||
/**
|
||||
* When mocking time, `Date.now()` will also be mocked. If you for some reason need access to the real current time, you can invoke this function.
|
||||
*
|
||||
* > Note: This function is only available when using Lolex as fake timers implementation
|
||||
*/
|
||||
getRealSystemTime(): number;
|
||||
/**
|
||||
* Set the current system time used by fake timers. Simulates a user changing the system clock while your program is running. It affects the current time but it does not in itself cause e.g. timers to fire; they will fire exactly as they would have done without the call to `jest.setSystemTime()`.
|
||||
*
|
||||
* > Note: This function is only available when using Lolex as fake timers implementation
|
||||
*/
|
||||
setSystemTime(now?: number | Date): void;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
Reference in New Issue
Block a user