Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

View File

@@ -4,14 +4,19 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/// <reference types="yargs" />
import { Config } from '@jest/types';
import { JestEnvironment } from '@jest/environment';
import { SourceMapRegistry } from '@jest/source-map';
import HasteMap, { ModuleMap } from 'jest-haste-map';
import Resolver from 'jest-resolve';
import { ScriptTransformer, ShouldInstrumentOptions } from '@jest/transform';
import { Context as JestContext } from './types';
import type { JestEnvironment } from '@jest/environment';
import type * as JestGlobals from '@jest/globals';
import type { SourceMapRegistry } from '@jest/source-map';
import type { V8CoverageResult } from '@jest/test-result';
import { CallerTransformOptions, ShouldInstrumentOptions, shouldInstrument } from '@jest/transform';
import type { Config, Global } from '@jest/types';
import HasteMap = require('jest-haste-map');
import Resolver = require('jest-resolve');
import { options as cliOptions } from './cli/args';
import type { Context as JestContext } from './types';
interface JestGlobals extends Global.TestFrameworkGlobals {
expect: typeof JestGlobals.expect;
}
declare type HasteMapOptions = {
console?: Console;
maxWorkers: number;
@@ -19,25 +24,24 @@ declare type HasteMapOptions = {
watch?: boolean;
watchman: boolean;
};
declare type InternalModuleOptions = {
interface InternalModuleOptions extends Required<CallerTransformOptions> {
isInternalModule: boolean;
};
declare type CacheFS = {
[path: string]: string;
};
}
declare namespace Runtime {
type Context = JestContext;
type RuntimeType = Runtime;
}
declare class Runtime {
static ScriptTransformer: typeof ScriptTransformer;
private _cacheFS;
private _config;
private _coverageOptions;
private _currentlyExecutingModulePath;
private _environment;
private _explicitShouldMock;
private _fakeTimersImplementation;
private _internalModuleRegistry;
private _isCurrentlyExecutingManualMock;
private _mainModule;
private _mockFactories;
private _mockMetaDataCache;
private _mockRegistry;
@@ -45,18 +49,25 @@ declare class Runtime {
private _moduleMocker;
private _isolatedModuleRegistry;
private _moduleRegistry;
private _needsCoverageMapped;
private _esmoduleRegistry;
private _testPath;
private _resolver;
private _shouldAutoMock;
private _shouldMockModuleCache;
private _shouldUnmockTransitiveDependenciesCache;
private _sourceMapRegistry;
private _scriptTransformer;
private _fileTransforms;
private _v8CoverageInstrumenter;
private _v8CoverageResult;
private _transitiveShouldMock;
private _unmockList;
private _virtualMocks;
constructor(config: Config.ProjectConfig, environment: JestEnvironment, resolver: Resolver, cacheFS?: CacheFS, coverageOptions?: ShouldInstrumentOptions);
static shouldInstrument(filename: Config.Path, options: ShouldInstrumentOptions, config: Config.ProjectConfig): boolean;
private _moduleImplementation?;
private jestObjectCaches;
private jestGlobals?;
constructor(config: Config.ProjectConfig, environment: JestEnvironment, resolver: Resolver, cacheFS?: Record<string, string>, coverageOptions?: ShouldInstrumentOptions, testPath?: Config.Path);
static shouldInstrument: typeof shouldInstrument;
static createContext(config: Config.ProjectConfig, options: {
console?: Console;
maxWorkers: number;
@@ -64,22 +75,28 @@ declare class Runtime {
watchman: boolean;
}): Promise<JestContext>;
static createHasteMap(config: Config.ProjectConfig, options?: HasteMapOptions): HasteMap;
static createResolver(config: Config.ProjectConfig, moduleMap: ModuleMap): Resolver;
static runCLI(args?: Config.Argv, info?: Array<string>): void;
static getCLIOptions(): Record<"cache" | "config" | "debug" | "version" | "watchman", import("yargs").Options>;
requireModule(from: Config.Path, moduleName?: string, options?: InternalModuleOptions, isRequireActual?: boolean | null): any;
requireInternalModule(from: Config.Path, to?: string): any;
requireActual(from: Config.Path, moduleName: string): any;
requireMock(from: Config.Path, moduleName: string): any;
static createResolver(config: Config.ProjectConfig, moduleMap: HasteMap.ModuleMap): Resolver;
static runCLI(args?: Config.Argv, info?: Array<string>): Promise<void>;
static getCLIOptions(): typeof cliOptions;
unstable_shouldLoadAsEsm: typeof import("jest-resolve/build/shouldLoadAsEsm").default;
private loadEsmModule;
private linkModules;
unstable_importModule(from: Config.Path, moduleName?: string): Promise<void>;
private loadCjsAsEsm;
requireModule<T = unknown>(from: Config.Path, moduleName?: string, options?: InternalModuleOptions, isRequireActual?: boolean | null): T;
requireInternalModule<T = unknown>(from: Config.Path, to?: string): T;
requireActual<T = unknown>(from: Config.Path, moduleName: string): T;
requireMock<T = unknown>(from: Config.Path, moduleName: string): T;
private _loadModule;
private _getFullTransformationOptions;
requireModuleOrMock(from: Config.Path, moduleName: string): any;
requireModuleOrMock<T = unknown>(from: Config.Path, moduleName: string): T;
isolateModules(fn: () => void): void;
resetModules(): void;
getAllCoverageInfoCopy(): import("istanbul-lib-coverage").CoverageMapData;
getSourceMapInfo(coveredFiles: Set<string>): {
[path: string]: string;
};
collectV8Coverage(): Promise<void>;
stopCollectingV8Coverage(): Promise<void>;
getAllCoverageInfoCopy(): JestEnvironment['global']['__coverage__'];
getAllV8CoverageInfoCopy(): V8CoverageResult;
getSourceMapInfo(_coveredFiles: Set<string>): Record<string, string>;
getSourceMaps(): SourceMapRegistry;
setMock(from: string, moduleName: string, mockFactory: () => unknown, options?: {
virtual?: boolean;
@@ -87,16 +104,29 @@ declare class Runtime {
restoreAllMocks(): void;
resetAllMocks(): void;
clearAllMocks(): void;
teardown(): void;
private _resolveModule;
private _requireResolve;
private _requireResolvePaths;
private _execModule;
private transformFile;
private createScriptFromCode;
private _requireCoreModule;
private _importCoreModule;
private _getMockedNativeModule;
private _generateMock;
private _shouldMock;
private _createRequireImplementation;
private _createJestObjectFor;
private _logFormattedReferenceError;
private wrapCodeInModuleWrapper;
private constructModuleWrapperStart;
private constructInjectedModuleParameters;
private handleExecutionError;
private getGlobalsForCjs;
private getGlobalsForEsm;
private getGlobalsFromEnvironment;
private readFile;
setGlobalsForRuntime(globals: JestGlobals): void;
}
export = Runtime;
//# sourceMappingURL=index.d.ts.map