/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
///
import type { ForegroundColor } from 'chalk';
import type { ReportOptions } from 'istanbul-reports';
import type { Arguments } from 'yargs';
declare type CoverageProvider = 'babel' | 'v8';
declare type Timers = 'real' | 'fake' | 'modern' | 'legacy';
export declare type Path = string;
export declare type Glob = string;
export declare type HasteConfig = {
/** Whether to hash files using SHA-1. */
computeSha1?: boolean;
/** The platform to use as the default, e.g. 'ios'. */
defaultPlatform?: string | null;
/** Path to a custom implementation of Haste. */
hasteImplModulePath?: string;
/** All platforms to target, e.g ['ios', 'android']. */
platforms?: Array;
/** Whether to throw on error on module collision. */
throwOnModuleCollision?: boolean;
};
export declare type CoverageReporterName = keyof ReportOptions;
export declare type CoverageReporterWithOptions = K extends CoverageReporterName ? ReportOptions[K] extends never ? never : [K, Partial] : never;
export declare type CoverageReporters = Array;
export declare type ReporterConfig = [string, Record];
export declare type TransformerConfig = [string, Record];
export interface ConfigGlobals {
[K: string]: unknown;
}
export declare type DefaultOptions = {
automock: boolean;
bail: number;
cache: boolean;
cacheDirectory: Path;
changedFilesWithAncestor: boolean;
clearMocks: boolean;
collectCoverage: boolean;
coveragePathIgnorePatterns: Array;
coverageReporters: Array;
coverageProvider: CoverageProvider;
errorOnDeprecated: boolean;
expand: boolean;
forceCoverageMatch: Array;
globals: ConfigGlobals;
haste: HasteConfig;
injectGlobals: boolean;
maxConcurrency: number;
maxWorkers: number | string;
moduleDirectories: Array;
moduleFileExtensions: Array;
moduleNameMapper: Record>;
modulePathIgnorePatterns: Array;
noStackTrace: boolean;
notify: boolean;
notifyMode: NotifyMode;
prettierPath: string;
resetMocks: boolean;
resetModules: boolean;
restoreMocks: boolean;
roots: Array;
runTestsByPath: boolean;
runner: 'jest-runner';
setupFiles: Array;
setupFilesAfterEnv: Array;
skipFilter: boolean;
slowTestThreshold: number;
snapshotSerializers: Array;
testEnvironment: string;
testEnvironmentOptions: Record;
testFailureExitCode: string | number;
testLocationInResults: boolean;
testMatch: Array;
testPathIgnorePatterns: Array;
testRegex: Array;
testRunner: string;
testSequencer: string;
testURL: string;
timers: Timers;
transformIgnorePatterns: Array;
useStderr: boolean;
watch: boolean;
watchPathIgnorePatterns: Array;
watchman: boolean;
};
export declare type DisplayName = {
name: string;
color: typeof ForegroundColor;
};
export declare type InitialOptionsWithRootDir = InitialOptions & Required>;
export declare type InitialOptions = Partial<{
automock: boolean;
bail: boolean | number;
cache: boolean;
cacheDirectory: Path;
clearMocks: boolean;
changedFilesWithAncestor: boolean;
changedSince: string;
collectCoverage: boolean;
collectCoverageFrom: Array;
collectCoverageOnlyFrom: {
[key: string]: boolean;
};
coverageDirectory: string;
coveragePathIgnorePatterns: Array;
coverageProvider: CoverageProvider;
coverageReporters: CoverageReporters;
coverageThreshold: {
global: {
[key: string]: number;
};
};
dependencyExtractor: string;
detectLeaks: boolean;
detectOpenHandles: boolean;
displayName: string | DisplayName;
expand: boolean;
extraGlobals: Array;
filter: Path;
findRelatedTests: boolean;
forceCoverageMatch: Array;
forceExit: boolean;
json: boolean;
globals: ConfigGlobals;
globalSetup: string | null | undefined;
globalTeardown: string | null | undefined;
haste: HasteConfig;
injectGlobals: boolean;
reporters: Array;
logHeapUsage: boolean;
lastCommit: boolean;
listTests: boolean;
mapCoverage: boolean;
maxConcurrency: number;
maxWorkers: number | string;
moduleDirectories: Array;
moduleFileExtensions: Array;
moduleLoader: Path;
moduleNameMapper: {
[key: string]: string | Array;
};
modulePathIgnorePatterns: Array;
modulePaths: Array;
name: string;
noStackTrace: boolean;
notify: boolean;
notifyMode: string;
onlyChanged: boolean;
onlyFailures: boolean;
outputFile: Path;
passWithNoTests: boolean;
preprocessorIgnorePatterns: Array;
preset: string | null | undefined;
prettierPath: string | null | undefined;
projects: Array;
replname: string | null | undefined;
resetMocks: boolean;
resetModules: boolean;
resolver: Path | null | undefined;
restoreMocks: boolean;
rootDir: Path;
roots: Array;
runner: string;
runTestsByPath: boolean;
scriptPreprocessor: string;
setupFiles: Array;
setupTestFrameworkScriptFile: Path;
setupFilesAfterEnv: Array;
silent: boolean;
skipFilter: boolean;
skipNodeResolution: boolean;
slowTestThreshold: number;
snapshotResolver: Path;
snapshotSerializers: Array;
errorOnDeprecated: boolean;
testEnvironment: string;
testEnvironmentOptions: Record;
testFailureExitCode: string | number;
testLocationInResults: boolean;
testMatch: Array;
testNamePattern: string;
testPathDirs: Array;
testPathIgnorePatterns: Array;
testRegex: string | Array;
testResultsProcessor: string;
testRunner: string;
testSequencer: string;
testURL: string;
testTimeout: number;
timers: Timers;
transform: {
[regex: string]: Path | TransformerConfig;
};
transformIgnorePatterns: Array;
watchPathIgnorePatterns: Array;
unmockedModulePathPatterns: Array;
updateSnapshot: boolean;
useStderr: boolean;
verbose?: boolean;
watch: boolean;
watchAll: boolean;
watchman: boolean;
watchPlugins: Array]>;
}>;
export declare type SnapshotUpdateState = 'all' | 'new' | 'none';
declare type NotifyMode = 'always' | 'failure' | 'success' | 'change' | 'success-change' | 'failure-change';
export declare type CoverageThresholdValue = {
branches?: number;
functions?: number;
lines?: number;
statements?: number;
};
declare type CoverageThreshold = {
[path: string]: CoverageThresholdValue;
global: CoverageThresholdValue;
};
export declare type GlobalConfig = {
bail: number;
changedSince?: string;
changedFilesWithAncestor: boolean;
collectCoverage: boolean;
collectCoverageFrom: Array;
collectCoverageOnlyFrom?: {
[key: string]: boolean;
};
coverageDirectory: string;
coveragePathIgnorePatterns?: Array;
coverageProvider: CoverageProvider;
coverageReporters: CoverageReporters;
coverageThreshold?: CoverageThreshold;
detectLeaks: boolean;
detectOpenHandles: boolean;
enabledTestsMap?: {
[key: string]: {
[key: string]: boolean;
};
};
expand: boolean;
filter?: Path;
findRelatedTests: boolean;
forceExit: boolean;
json: boolean;
globalSetup?: string;
globalTeardown?: string;
lastCommit: boolean;
logHeapUsage: boolean;
listTests: boolean;
maxConcurrency: number;
maxWorkers: number;
noStackTrace: boolean;
nonFlagArgs: Array;
noSCM?: boolean;
notify: boolean;
notifyMode: NotifyMode;
outputFile?: Path;
onlyChanged: boolean;
onlyFailures: boolean;
passWithNoTests: boolean;
projects: Array;
replname?: string;
reporters?: Array;
runTestsByPath: boolean;
rootDir: Path;
silent?: boolean;
skipFilter: boolean;
errorOnDeprecated: boolean;
testFailureExitCode: number;
testNamePattern?: string;
testPathPattern: string;
testResultsProcessor?: string;
testSequencer: string;
testTimeout?: number;
updateSnapshot: SnapshotUpdateState;
useStderr: boolean;
verbose?: boolean;
watch: boolean;
watchAll: boolean;
watchman: boolean;
watchPlugins?: Array<{
path: string;
config: Record;
}> | null;
};
export declare type ProjectConfig = {
automock: boolean;
cache: boolean;
cacheDirectory: Path;
clearMocks: boolean;
coveragePathIgnorePatterns: Array;
cwd: Path;
dependencyExtractor?: string;
detectLeaks: boolean;
detectOpenHandles: boolean;
displayName?: DisplayName;
errorOnDeprecated: boolean;
extraGlobals: Array;
filter?: Path;
forceCoverageMatch: Array;
globalSetup?: string;
globalTeardown?: string;
globals: ConfigGlobals;
haste: HasteConfig;
injectGlobals: boolean;
moduleDirectories: Array;
moduleFileExtensions: Array;
moduleLoader?: Path;
moduleNameMapper: Array<[string, string]>;
modulePathIgnorePatterns: Array;
modulePaths?: Array;
name: string;
prettierPath: string;
resetMocks: boolean;
resetModules: boolean;
resolver?: Path;
restoreMocks: boolean;
rootDir: Path;
roots: Array;
runner: string;
setupFiles: Array;
setupFilesAfterEnv: Array;
skipFilter: boolean;
skipNodeResolution?: boolean;
slowTestThreshold: number;
snapshotResolver?: Path;
snapshotSerializers: Array;
testEnvironment: string;
testEnvironmentOptions: Record;
testMatch: Array;
testLocationInResults: boolean;
testPathIgnorePatterns: Array;
testRegex: Array;
testRunner: string;
testURL: string;
timers: Timers;
transform: Array<[string, Path, Record]>;
transformIgnorePatterns: Array;
watchPathIgnorePatterns: Array;
unmockedModulePathPatterns?: Array;
};
export declare type Argv = Arguments;
color: boolean;
colors: boolean;
config: string;
coverage: boolean;
coverageDirectory: string;
coveragePathIgnorePatterns: Array;
coverageReporters: Array;
coverageThreshold: string;
debug: boolean;
env: string;
expand: boolean;
findRelatedTests: boolean;
forceExit: boolean;
globals: string;
globalSetup: string | null | undefined;
globalTeardown: string | null | undefined;
haste: string;
init: boolean;
injectGlobals: boolean;
json: boolean;
lastCommit: boolean;
logHeapUsage: boolean;
maxWorkers: number | string;
moduleDirectories: Array;
moduleFileExtensions: Array;
moduleNameMapper: string;
modulePathIgnorePatterns: Array;
modulePaths: Array;
noStackTrace: boolean;
notify: boolean;
notifyMode: string;
onlyChanged: boolean;
onlyFailures: boolean;
outputFile: string;
preset: string | null | undefined;
projects: Array;
prettierPath: string | null | undefined;
resetMocks: boolean;
resetModules: boolean;
resolver: string | null | undefined;
restoreMocks: boolean;
rootDir: string;
roots: Array;
runInBand: boolean;
selectProjects: Array;
setupFiles: Array;
setupFilesAfterEnv: Array;
showConfig: boolean;
silent: boolean;
snapshotSerializers: Array;
testEnvironment: string;
testFailureExitCode: string | null | undefined;
testMatch: Array;
testNamePattern: string;
testPathIgnorePatterns: Array;
testPathPattern: Array;
testRegex: string | Array;
testResultsProcessor: string;
testRunner: string;
testSequencer: string;
testURL: string;
testTimeout: number | null | undefined;
timers: string;
transform: string;
transformIgnorePatterns: Array;
unmockedModulePathPatterns: Array | null | undefined;
updateSnapshot: boolean;
useStderr: boolean;
verbose: boolean;
version: boolean;
watch: boolean;
watchAll: boolean;
watchman: boolean;
watchPathIgnorePatterns: Array;
}>>;
export {};