This commit is contained in:
Domen Kožar 2019-11-19 17:50:30 +01:00
parent cd5893b2c6
commit 70742d22d9
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
6774 changed files with 1602535 additions and 1 deletions

580
node_modules/jest-cli/build/cli/args.d.ts generated vendored Normal file
View file

@ -0,0 +1,580 @@
/**
* 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.
*/
/// <reference types="yargs" />
export declare const check: (argv: import("yargs").Arguments<Partial<{
all: boolean;
automock: boolean;
bail: number | boolean;
browser: boolean;
cache: boolean;
cacheDirectory: string;
changedFilesWithAncestor: boolean;
changedSince: string;
ci: boolean;
clearCache: boolean;
clearMocks: boolean;
collectCoverage: boolean;
collectCoverageFrom: string;
collectCoverageOnlyFrom: string[];
color: boolean;
colors: boolean;
config: string;
coverage: boolean;
coverageDirectory: string;
coveragePathIgnorePatterns: string[];
coverageReporters: string[];
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;
json: boolean;
lastCommit: boolean;
logHeapUsage: boolean;
maxWorkers: string | number;
moduleDirectories: string[];
moduleFileExtensions: string[];
moduleNameMapper: string;
modulePathIgnorePatterns: string[];
modulePaths: string[];
noStackTrace: boolean;
notify: boolean;
notifyMode: string;
onlyChanged: boolean;
outputFile: string;
preset: string | null | undefined;
projects: string[];
prettierPath: string | null | undefined;
resetMocks: boolean;
resetModules: boolean;
resolver: string | null | undefined;
restoreMocks: boolean;
rootDir: string;
roots: string[];
runInBand: boolean;
setupFiles: string[];
setupFilesAfterEnv: string[];
showConfig: boolean;
silent: boolean;
snapshotSerializers: string[];
testEnvironment: string;
testFailureExitCode: string | null | undefined;
testMatch: string[];
testNamePattern: string;
testPathIgnorePatterns: string[];
testPathPattern: string[];
testRegex: string | string[];
testResultsProcessor: string | null | undefined;
testRunner: string;
testSequencer: string;
testURL: string;
testTimeout: number | null | undefined;
timers: string;
transform: string;
transformIgnorePatterns: string[];
unmockedModulePathPatterns: string[] | null | undefined;
updateSnapshot: boolean;
useStderr: boolean;
verbose: boolean | null | undefined;
version: boolean;
watch: boolean;
watchAll: boolean;
watchman: boolean;
watchPathIgnorePatterns: string[];
}>>) => boolean;
export declare const usage = "Usage: $0 [--config=<pathToConfigFile>] [TestPathPattern]";
export declare const docs = "Documentation: https://jestjs.io/";
export declare const options: {
all: {
default: undefined;
description: string;
type: "boolean";
};
automock: {
default: undefined;
description: string;
type: "boolean";
};
bail: {
alias: string;
default: undefined;
description: string;
type: "boolean";
};
browser: {
default: undefined;
description: string;
type: "boolean";
};
cache: {
default: undefined;
description: string;
type: "boolean";
};
cacheDirectory: {
description: string;
type: "string";
};
changedFilesWithAncestor: {
default: undefined;
description: string;
type: "boolean";
};
changedSince: {
description: string;
nargs: number;
type: "string";
};
ci: {
default: boolean;
description: string;
type: "boolean";
};
clearCache: {
default: undefined;
description: string;
type: "boolean";
};
clearMocks: {
default: undefined;
description: string;
type: "boolean";
};
collectCoverage: {
default: undefined;
description: string;
type: "boolean";
};
collectCoverageFrom: {
description: string;
type: "string";
};
collectCoverageOnlyFrom: {
description: string;
string: true;
type: "array";
};
color: {
default: undefined;
description: string;
type: "boolean";
};
colors: {
default: undefined;
description: string;
type: "boolean";
};
config: {
alias: string;
description: string;
type: "string";
};
coverage: {
default: undefined;
description: string;
type: "boolean";
};
coverageDirectory: {
description: string;
type: "string";
};
coveragePathIgnorePatterns: {
description: string;
string: true;
type: "array";
};
coverageReporters: {
description: string;
string: true;
type: "array";
};
coverageThreshold: {
description: string;
type: "string";
};
debug: {
default: undefined;
description: string;
type: "boolean";
};
detectLeaks: {
default: boolean;
description: string;
type: "boolean";
};
detectOpenHandles: {
default: boolean;
description: string;
type: "boolean";
};
env: {
description: string;
type: "string";
};
errorOnDeprecated: {
default: boolean;
description: string;
type: "boolean";
};
expand: {
alias: string;
default: undefined;
description: string;
type: "boolean";
};
filter: {
default: undefined;
description: string;
type: "string";
};
findRelatedTests: {
default: undefined;
description: string;
type: "boolean";
};
forceExit: {
default: undefined;
description: string;
type: "boolean";
};
globalSetup: {
description: string;
type: "string";
};
globalTeardown: {
description: string;
type: "string";
};
globals: {
description: string;
type: "string";
};
haste: {
description: string;
type: "string";
};
init: {
description: string;
type: "boolean";
};
json: {
default: undefined;
description: string;
type: "boolean";
};
lastCommit: {
default: undefined;
description: string;
type: "boolean";
};
listTests: {
default: boolean;
description: string;
type: "boolean";
};
logHeapUsage: {
default: undefined;
description: string;
type: "boolean";
};
mapCoverage: {
default: undefined;
description: string;
type: "boolean";
};
maxConcurrency: {
default: number;
description: string;
type: "number";
};
maxWorkers: {
alias: string;
description: string;
type: "string";
};
moduleDirectories: {
description: string;
string: true;
type: "array";
};
moduleFileExtensions: {
description: string;
string: true;
type: "array";
};
moduleNameMapper: {
description: string;
type: "string";
};
modulePathIgnorePatterns: {
description: string;
string: true;
type: "array";
};
modulePaths: {
description: string;
string: true;
type: "array";
};
noStackTrace: {
default: undefined;
description: string;
type: "boolean";
};
notify: {
default: undefined;
description: string;
type: "boolean";
};
notifyMode: {
default: string;
description: string;
type: "string";
};
onlyChanged: {
alias: string;
default: undefined;
description: string;
type: "boolean";
};
onlyFailures: {
alias: string;
default: undefined;
description: string;
type: "boolean";
};
outputFile: {
description: string;
type: "string";
};
passWithNoTests: {
default: boolean;
description: string;
type: "boolean";
};
preset: {
description: string;
type: "string";
};
prettierPath: {
default: undefined;
description: string;
type: "string";
};
projects: {
description: string;
string: true;
type: "array";
};
reporters: {
description: string;
string: true;
type: "array";
};
resetMocks: {
default: undefined;
description: string;
type: "boolean";
};
resetModules: {
default: undefined;
description: string;
type: "boolean";
};
resolver: {
description: string;
type: "string";
};
restoreMocks: {
default: undefined;
description: string;
type: "boolean";
};
rootDir: {
description: string;
type: "string";
};
roots: {
description: string;
string: true;
type: "array";
};
runInBand: {
alias: string;
default: undefined;
description: string;
type: "boolean";
};
runTestsByPath: {
default: boolean;
description: string;
type: "boolean";
};
runner: {
description: string;
type: "string";
};
setupFiles: {
description: string;
string: true;
type: "array";
};
setupFilesAfterEnv: {
description: string;
string: true;
type: "array";
};
showConfig: {
default: undefined;
description: string;
type: "boolean";
};
silent: {
default: undefined;
description: string;
type: "boolean";
};
skipFilter: {
default: undefined;
description: string;
type: "boolean";
};
snapshotSerializers: {
description: string;
string: true;
type: "array";
};
testEnvironment: {
description: string;
type: "string";
};
testEnvironmentOptions: {
description: string;
type: "string";
};
testFailureExitCode: {
description: string;
type: "string";
};
testLocationInResults: {
default: boolean;
description: string;
type: "boolean";
};
testMatch: {
description: string;
string: true;
type: "array";
};
testNamePattern: {
alias: string;
description: string;
type: "string";
};
testPathIgnorePatterns: {
description: string;
string: true;
type: "array";
};
testPathPattern: {
description: string;
string: true;
type: "array";
};
testRegex: {
description: string;
string: true;
type: "array";
};
testResultsProcessor: {
description: string;
type: "string";
};
testRunner: {
description: string;
type: "string";
};
testSequencer: {
description: string;
type: "string";
};
testTimeout: {
description: string;
type: "number";
};
testURL: {
description: string;
type: "string";
};
timers: {
description: string;
type: "string";
};
transform: {
description: string;
type: "string";
};
transformIgnorePatterns: {
description: string;
string: true;
type: "array";
};
unmockedModulePathPatterns: {
description: string;
string: true;
type: "array";
};
updateSnapshot: {
alias: string;
default: undefined;
description: string;
type: "boolean";
};
useStderr: {
default: undefined;
description: string;
type: "boolean";
};
verbose: {
default: undefined;
description: string;
type: "boolean";
};
version: {
alias: string;
default: undefined;
description: string;
type: "boolean";
};
watch: {
default: undefined;
description: string;
type: "boolean";
};
watchAll: {
default: undefined;
description: string;
type: "boolean";
};
watchPathIgnorePatterns: {
description: string;
string: true;
type: "array";
};
watchman: {
default: undefined;
description: string;
type: "boolean";
};
};
//# sourceMappingURL=args.d.ts.map

1
node_modules/jest-cli/build/cli/args.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAMH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAoDjB,CAAC;AAEF,eAAO,MAAM,KAAK,8DAC2C,CAAC;AAC9D,eAAO,MAAM,IAAI,sCAAsC,CAAC;AAExD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2oBnB,CAAC"}

753
node_modules/jest-cli/build/cli/args.js generated vendored Normal file
View file

@ -0,0 +1,753 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.options = exports.docs = exports.usage = exports.check = void 0;
function _jestConfig() {
const data = require('jest-config');
_jestConfig = function _jestConfig() {
return data;
};
return data;
}
function _isCi() {
const data = _interopRequireDefault(require('is-ci'));
_isCi = function _isCi() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* 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.
*/
const check = argv => {
if (argv.runInBand && argv.hasOwnProperty('maxWorkers')) {
throw new Error(
'Both --runInBand and --maxWorkers were specified, but these two ' +
'options do not make sense together. Which is it?'
);
}
var _arr = [
'onlyChanged',
'lastCommit',
'changedFilesWithAncestor',
'changedSince'
];
for (var _i = 0; _i < _arr.length; _i++) {
const key = _arr[_i];
if (argv[key] && argv.watchAll) {
throw new Error(
`Both --${key} and --watchAll were specified, but these two ` +
'options do not make sense together. Try the --watch option which ' +
'reruns only tests related to changed files.'
);
}
}
if (argv.findRelatedTests && argv._.length === 0) {
throw new Error(
'The --findRelatedTests option requires file paths to be specified.\n' +
'Example usage: jest --findRelatedTests ./src/source.js ' +
'./src/index.js.'
);
}
if (argv.hasOwnProperty('maxWorkers') && argv.maxWorkers === undefined) {
throw new Error(
'The --maxWorkers (-w) option requires a number or string to be specified.\n' +
'Example usage: jest --maxWorkers 2\n' +
'Example usage: jest --maxWorkers 50%\n' +
'Or did you mean --watch?'
);
}
if (
argv.config &&
!(0, _jestConfig().isJSONString)(argv.config) &&
!argv.config.match(/\.js(on)?$/)
) {
throw new Error(
'The --config option requires a JSON string literal, or a file path with a .js or .json extension.\n' +
'Example usage: jest --config ./jest.config.js'
);
}
return true;
};
exports.check = check;
const usage = 'Usage: $0 [--config=<pathToConfigFile>] [TestPathPattern]';
exports.usage = usage;
const docs = 'Documentation: https://jestjs.io/';
exports.docs = docs;
const options = {
all: {
default: undefined,
description:
'The opposite of `onlyChanged`. If `onlyChanged` is set by ' +
'default, running jest with `--all` will force Jest to run all tests ' +
'instead of running only tests related to changed files.',
type: 'boolean'
},
automock: {
default: undefined,
description: 'Automock all files by default.',
type: 'boolean'
},
bail: {
alias: 'b',
default: undefined,
description:
'Exit the test suite immediately after `n` number of failing tests.',
type: 'boolean'
},
browser: {
default: undefined,
description:
'Respect the "browser" field in package.json ' +
'when resolving modules. Some packages export different versions ' +
'based on whether they are operating in node.js or a browser.',
type: 'boolean'
},
cache: {
default: undefined,
description:
'Whether to use the transform cache. Disable the cache ' +
'using --no-cache.',
type: 'boolean'
},
cacheDirectory: {
description:
'The directory where Jest should store its cached ' +
' dependency information.',
type: 'string'
},
changedFilesWithAncestor: {
default: undefined,
description:
'Runs tests related to the current changes and the changes made in the ' +
'last commit. Behaves similarly to `--onlyChanged`.',
type: 'boolean'
},
changedSince: {
description:
'Runs tests related to the changes since the provided branch. If the ' +
'current branch has diverged from the given branch, then only changes ' +
'made locally will be tested. Behaves similarly to `--onlyChanged`.',
nargs: 1,
type: 'string'
},
ci: {
default: _isCi().default,
description:
'Whether to run Jest in continuous integration (CI) mode. ' +
'This option is on by default in most popular CI environments. It will ' +
' prevent snapshots from being written unless explicitly requested.',
type: 'boolean'
},
clearCache: {
default: undefined,
description:
'Clears the configured Jest cache directory and then exits. ' +
'Default directory can be found by calling jest --showConfig',
type: 'boolean'
},
clearMocks: {
default: undefined,
description:
'Automatically clear mock calls and instances between every ' +
'test. Equivalent to calling jest.clearAllMocks() between each test.',
type: 'boolean'
},
collectCoverage: {
default: undefined,
description: 'Alias for --coverage.',
type: 'boolean'
},
collectCoverageFrom: {
description:
'A glob pattern relative to <rootDir> matching the files that coverage ' +
'info needs to be collected from.',
type: 'string'
},
collectCoverageOnlyFrom: {
description: 'Explicit list of paths coverage will be restricted to.',
string: true,
type: 'array'
},
color: {
default: undefined,
description:
'Forces test results output color highlighting (even if ' +
'stdout is not a TTY). Set to false if you would like to have no colors.',
type: 'boolean'
},
colors: {
default: undefined,
description: 'Alias for `--color`.',
type: 'boolean'
},
config: {
alias: 'c',
description:
'The path to a jest config file specifying how to find ' +
'and execute tests. If no rootDir is set in the config, the directory ' +
'containing the config file is assumed to be the rootDir for the project.' +
'This can also be a JSON encoded value which Jest will use as configuration.',
type: 'string'
},
coverage: {
default: undefined,
description:
'Indicates that test coverage information should be ' +
'collected and reported in the output.',
type: 'boolean'
},
coverageDirectory: {
description: 'The directory where Jest should output its coverage files.',
type: 'string'
},
coveragePathIgnorePatterns: {
description:
'An array of regexp pattern strings that are matched ' +
'against all file paths before executing the test. If the file path' +
'matches any of the patterns, coverage information will be skipped.',
string: true,
type: 'array'
},
coverageReporters: {
description:
'A list of reporter names that Jest uses when writing ' +
'coverage reports. Any istanbul reporter can be used.',
string: true,
type: 'array'
},
coverageThreshold: {
description:
'A JSON string with which will be used to configure ' +
'minimum threshold enforcement for coverage results',
type: 'string'
},
debug: {
default: undefined,
description: 'Print debugging info about your jest config.',
type: 'boolean'
},
detectLeaks: {
default: false,
description:
'**EXPERIMENTAL**: Detect memory leaks in tests. After executing a ' +
'test, it will try to garbage collect the global object used, and fail ' +
'if it was leaked',
type: 'boolean'
},
detectOpenHandles: {
default: false,
description:
'Print out remaining open handles preventing Jest from exiting at the ' +
'end of a test run. Implies `runInBand`.',
type: 'boolean'
},
env: {
description:
'The test environment used for all tests. This can point to ' +
'any file or node module. Examples: `jsdom`, `node` or ' +
'`path/to/my-environment.js`',
type: 'string'
},
errorOnDeprecated: {
default: false,
description: 'Make calling deprecated APIs throw helpful error messages.',
type: 'boolean'
},
expand: {
alias: 'e',
default: undefined,
description: 'Use this flag to show full diffs instead of a patch.',
type: 'boolean'
},
filter: {
default: undefined,
description:
'Path to a module exporting a filtering function. This method receives ' +
'a list of tests which can be manipulated to exclude tests from ' +
'running. Especially useful when used in conjunction with a testing ' +
'infrastructure to filter known broken tests.',
type: 'string'
},
findRelatedTests: {
default: undefined,
description:
'Find related tests for a list of source files that were ' +
'passed in as arguments. Useful for pre-commit hook integration to run ' +
'the minimal amount of tests necessary.',
type: 'boolean'
},
forceExit: {
default: undefined,
description:
'Force Jest to exit after all tests have completed running. ' +
'This is useful when resources set up by test code cannot be ' +
'adequately cleaned up.',
type: 'boolean'
},
globalSetup: {
description: 'The path to a module that runs before All Tests.',
type: 'string'
},
globalTeardown: {
description: 'The path to a module that runs after All Tests.',
type: 'string'
},
globals: {
description:
'A JSON string with map of global variables that need ' +
'to be available in all test environments.',
type: 'string'
},
haste: {
description:
'A JSON string with map of variables for the haste module system',
type: 'string'
},
init: {
description: 'Generate a basic configuration file',
type: 'boolean'
},
json: {
default: undefined,
description:
'Prints the test results in JSON. This mode will send all ' +
'other test output and user messages to stderr.',
type: 'boolean'
},
lastCommit: {
default: undefined,
description:
'Run all tests affected by file changes in the last commit made. ' +
'Behaves similarly to `--onlyChanged`.',
type: 'boolean'
},
listTests: {
default: false,
description:
'Lists all tests Jest will run given the arguments and ' +
'exits. Most useful in a CI system together with `--findRelatedTests` ' +
'to determine the tests Jest will run based on specific files',
type: 'boolean'
},
logHeapUsage: {
default: undefined,
description:
'Logs the heap usage after every test. Useful to debug ' +
'memory leaks. Use together with `--runInBand` and `--expose-gc` in ' +
'node.',
type: 'boolean'
},
mapCoverage: {
default: undefined,
description:
'Maps code coverage reports against original source code ' +
'when transformers supply source maps.\n\nDEPRECATED',
type: 'boolean'
},
maxConcurrency: {
default: 5,
description:
'Specifies the maximum number of tests that are allowed to run' +
'concurrently. This only affects tests using `test.concurrent`.',
type: 'number'
},
maxWorkers: {
alias: 'w',
description:
'Specifies the maximum number of workers the worker-pool ' +
'will spawn for running tests. This defaults to the number of the ' +
'cores available on your machine. (its usually best not to override ' +
'this default)',
type: 'string'
},
moduleDirectories: {
description:
'An array of directory names to be searched recursively ' +
"up from the requiring module's location.",
string: true,
type: 'array'
},
moduleFileExtensions: {
description:
'An array of file extensions your modules use. If you ' +
'require modules without specifying a file extension, these are the ' +
'extensions Jest will look for. ',
string: true,
type: 'array'
},
moduleNameMapper: {
description:
'A JSON string with a map from regular expressions to ' +
'module names that allow to stub out resources, like images or ' +
'styles with a single module',
type: 'string'
},
modulePathIgnorePatterns: {
description:
'An array of regexp pattern strings that are matched ' +
'against all module paths before those paths are to be considered ' +
'"visible" to the module loader.',
string: true,
type: 'array'
},
modulePaths: {
description:
'An alternative API to setting the NODE_PATH env variable, ' +
'modulePaths is an array of absolute paths to additional locations to ' +
'search when resolving modules.',
string: true,
type: 'array'
},
noStackTrace: {
default: undefined,
description: 'Disables stack trace in test results output',
type: 'boolean'
},
notify: {
default: undefined,
description: 'Activates notifications for test results.',
type: 'boolean'
},
notifyMode: {
default: 'failure-change',
description: 'Specifies when notifications will appear for test results.',
type: 'string'
},
onlyChanged: {
alias: 'o',
default: undefined,
description:
'Attempts to identify which tests to run based on which ' +
"files have changed in the current repository. Only works if you're " +
'running tests in a git or hg repository at the moment.',
type: 'boolean'
},
onlyFailures: {
alias: 'f',
default: undefined,
description: 'Run tests that failed in the previous execution.',
type: 'boolean'
},
outputFile: {
description:
'Write test results to a file when the --json option is ' +
'also specified.',
type: 'string'
},
passWithNoTests: {
default: false,
description:
'Will not fail if no tests are found (for example while using `--testPathPattern`.)',
type: 'boolean'
},
preset: {
description: "A preset that is used as a base for Jest's configuration.",
type: 'string'
},
prettierPath: {
default: undefined,
description: 'The path to the "prettier" module used for inline snapshots.',
type: 'string'
},
projects: {
description:
'A list of projects that use Jest to run all tests of all ' +
'projects in a single instance of Jest.',
string: true,
type: 'array'
},
reporters: {
description: 'A list of custom reporters for the test suite.',
string: true,
type: 'array'
},
resetMocks: {
default: undefined,
description:
'Automatically reset mock state between every test. ' +
'Equivalent to calling jest.resetAllMocks() between each test.',
type: 'boolean'
},
resetModules: {
default: undefined,
description:
'If enabled, the module registry for every test file will ' +
'be reset before running each individual test.',
type: 'boolean'
},
resolver: {
description: 'A JSON string which allows the use of a custom resolver.',
type: 'string'
},
restoreMocks: {
default: undefined,
description:
'Automatically restore mock state and implementation between every test. ' +
'Equivalent to calling jest.restoreAllMocks() between each test.',
type: 'boolean'
},
rootDir: {
description:
'The root directory that Jest should scan for tests and ' +
'modules within.',
type: 'string'
},
roots: {
description:
'A list of paths to directories that Jest should use to ' +
'search for files in.',
string: true,
type: 'array'
},
runInBand: {
alias: 'i',
default: undefined,
description:
'Run all tests serially in the current process (rather than ' +
'creating a worker pool of child processes that run tests). This ' +
'is sometimes useful for debugging, but such use cases are pretty ' +
'rare.',
type: 'boolean'
},
runTestsByPath: {
default: false,
description:
'Used when provided patterns are exact file paths. This avoids ' +
'converting them into a regular expression and matching it against ' +
'every single file.',
type: 'boolean'
},
runner: {
description:
"Allows to use a custom runner instead of Jest's default test runner.",
type: 'string'
},
setupFiles: {
description:
'A list of paths to modules that run some code to configure or ' +
'set up the testing environment before each test. ',
string: true,
type: 'array'
},
setupFilesAfterEnv: {
description:
'A list of paths to modules that run some code to configure or ' +
'set up the testing framework before each test ',
string: true,
type: 'array'
},
showConfig: {
default: undefined,
description: 'Print your jest config and then exits.',
type: 'boolean'
},
silent: {
default: undefined,
description: 'Prevent tests from printing messages through the console.',
type: 'boolean'
},
skipFilter: {
default: undefined,
description:
'Disables the filter provided by --filter. Useful for CI jobs, or ' +
'local enforcement when fixing tests.',
type: 'boolean'
},
snapshotSerializers: {
description:
'A list of paths to snapshot serializer modules Jest should ' +
'use for snapshot testing.',
string: true,
type: 'array'
},
testEnvironment: {
description: 'Alias for --env',
type: 'string'
},
testEnvironmentOptions: {
description:
'Test environment options that will be passed to the testEnvironment. ' +
'The relevant options depend on the environment.',
type: 'string' // Object
},
testFailureExitCode: {
description: 'Exit code of `jest` command if the test run failed',
type: 'string' // number
},
testLocationInResults: {
default: false,
description: 'Add `location` information to the test results',
type: 'boolean'
},
testMatch: {
description: 'The glob patterns Jest uses to detect test files.',
string: true,
type: 'array'
},
testNamePattern: {
alias: 't',
description: 'Run only tests with a name that matches the regex pattern.',
type: 'string'
},
testPathIgnorePatterns: {
description:
'An array of regexp pattern strings that are matched ' +
'against all test paths before executing the test. If the test path ' +
'matches any of the patterns, it will be skipped.',
string: true,
type: 'array'
},
testPathPattern: {
description:
'A regexp pattern string that is matched against all tests ' +
'paths before executing the test.',
string: true,
type: 'array'
},
testRegex: {
description:
'A string or array of string regexp patterns that Jest uses to detect test files.',
string: true,
type: 'array'
},
testResultsProcessor: {
description:
'Allows the use of a custom results processor. ' +
'This processor must be a node module that exports ' +
'a function expecting as the first argument the result object.',
type: 'string'
},
testRunner: {
description:
'Allows to specify a custom test runner. The default is ' +
' `jasmine2`. A path to a custom test runner can be provided: ' +
'`<rootDir>/path/to/testRunner.js`.',
type: 'string'
},
testSequencer: {
description:
'Allows to specify a custom test sequencer. The default is ' +
'`@jest/test-sequencer`. A path to a custom test sequencer can be ' +
'provided: `<rootDir>/path/to/testSequencer.js`',
type: 'string'
},
testTimeout: {
description: 'This option sets the default timeouts of test cases.',
type: 'number'
},
testURL: {
description: 'This option sets the URL for the jsdom environment.',
type: 'string'
},
timers: {
description:
'Setting this value to fake allows the use of fake timers ' +
'for functions such as setTimeout.',
type: 'string'
},
transform: {
description:
'A JSON string which maps from regular expressions to paths ' +
'to transformers.',
type: 'string'
},
transformIgnorePatterns: {
description:
'An array of regexp pattern strings that are matched ' +
'against all source file paths before transformation.',
string: true,
type: 'array'
},
unmockedModulePathPatterns: {
description:
'An array of regexp pattern strings that are matched ' +
'against all modules before the module loader will automatically ' +
'return a mock for them.',
string: true,
type: 'array'
},
updateSnapshot: {
alias: 'u',
default: undefined,
description:
'Use this flag to re-record snapshots. ' +
'Can be used together with a test suite pattern or with ' +
'`--testNamePattern` to re-record snapshot for test matching ' +
'the pattern',
type: 'boolean'
},
useStderr: {
default: undefined,
description: 'Divert all output to stderr.',
type: 'boolean'
},
verbose: {
default: undefined,
description:
'Display individual test results with the test suite hierarchy.',
type: 'boolean'
},
version: {
alias: 'v',
default: undefined,
description: 'Print the version and exit',
type: 'boolean'
},
watch: {
default: undefined,
description:
'Watch files for changes and rerun tests related to ' +
'changed files. If you want to re-run all tests when a file has ' +
'changed, use the `--watchAll` option.',
type: 'boolean'
},
watchAll: {
default: undefined,
description:
'Watch files for changes and rerun all tests. If you want ' +
'to re-run only the tests related to the changed files, use the ' +
'`--watch` option.',
type: 'boolean'
},
watchPathIgnorePatterns: {
description:
'An array of regexp pattern strings that are matched ' +
'against all paths before trigger test re-run in watch mode. ' +
'If the test path matches any of the patterns, it will be skipped.',
string: true,
type: 'array'
},
watchman: {
default: undefined,
description:
'Whether to use watchman for file crawling. Disable using ' +
'--no-watchman.',
type: 'boolean'
}
};
exports.options = options;

97
node_modules/jest-cli/build/cli/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,97 @@
/**
* 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 { Config } from '@jest/types';
import yargs from 'yargs';
export declare function run(maybeArgv?: Array<string>, project?: Config.Path): Promise<void>;
export declare const buildArgv: (maybeArgv?: string[] | undefined) => yargs.Arguments<Partial<{
all: boolean;
automock: boolean;
bail: number | boolean;
browser: boolean;
cache: boolean;
cacheDirectory: string;
changedFilesWithAncestor: boolean;
changedSince: string;
ci: boolean;
clearCache: boolean;
clearMocks: boolean;
collectCoverage: boolean;
collectCoverageFrom: string;
collectCoverageOnlyFrom: string[];
color: boolean;
colors: boolean;
config: string;
coverage: boolean;
coverageDirectory: string;
coveragePathIgnorePatterns: string[];
coverageReporters: string[];
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;
json: boolean;
lastCommit: boolean;
logHeapUsage: boolean;
maxWorkers: string | number;
moduleDirectories: string[];
moduleFileExtensions: string[];
moduleNameMapper: string;
modulePathIgnorePatterns: string[];
modulePaths: string[];
noStackTrace: boolean;
notify: boolean;
notifyMode: string;
onlyChanged: boolean;
outputFile: string;
preset: string | null | undefined;
projects: string[];
prettierPath: string | null | undefined;
resetMocks: boolean;
resetModules: boolean;
resolver: string | null | undefined;
restoreMocks: boolean;
rootDir: string;
roots: string[];
runInBand: boolean;
setupFiles: string[];
setupFilesAfterEnv: string[];
showConfig: boolean;
silent: boolean;
snapshotSerializers: string[];
testEnvironment: string;
testFailureExitCode: string | null | undefined;
testMatch: string[];
testNamePattern: string;
testPathIgnorePatterns: string[];
testPathPattern: string[];
testRegex: string | string[];
testResultsProcessor: string | null | undefined;
testRunner: string;
testSequencer: string;
testURL: string;
testTimeout: number | null | undefined;
timers: string;
transform: string;
transformIgnorePatterns: string[];
unmockedModulePathPatterns: string[] | null | undefined;
updateSnapshot: boolean;
useStderr: boolean;
verbose: boolean | null | undefined;
version: boolean;
watch: boolean;
watchAll: boolean;
watchman: boolean;
watchPathIgnorePatterns: string[];
}>>;
//# sourceMappingURL=index.d.ts.map

1
node_modules/jest-cli/build/cli/index.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAQnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,wBAAsB,GAAG,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,IAAI,iBAyBzE;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCrB,CAAC"}

325
node_modules/jest-cli/build/cli/index.js generated vendored Normal file
View file

@ -0,0 +1,325 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.run = run;
exports.buildArgv = void 0;
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
return data;
};
return data;
}
function _jestValidate() {
const data = require('jest-validate');
_jestValidate = function _jestValidate() {
return data;
};
return data;
}
function _jestConfig() {
const data = require('jest-config');
_jestConfig = function _jestConfig() {
return data;
};
return data;
}
function _core() {
const data = require('@jest/core');
_core = function _core() {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
function _exit() {
const data = _interopRequireDefault(require('exit'));
_exit = function _exit() {
return data;
};
return data;
}
function _yargs() {
const data = _interopRequireDefault(require('yargs'));
_yargs = function _yargs() {
return data;
};
return data;
}
function _realpathNative() {
const data = require('realpath-native');
_realpathNative = function _realpathNative() {
return data;
};
return data;
}
var _init = _interopRequireDefault(require('../init'));
var args = _interopRequireWildcard(require('./args'));
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc =
Object.defineProperty && Object.getOwnPropertyDescriptor
? Object.getOwnPropertyDescriptor(obj, key)
: {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
function run(_x, _x2) {
return _run.apply(this, arguments);
}
function _run() {
_run = _asyncToGenerator(function*(maybeArgv, project) {
try {
const argv = buildArgv(maybeArgv);
if (argv.init) {
yield (0, _init.default)();
return;
}
const projects = getProjectListFromCLIArgs(argv, project);
const _ref = yield (0, _core().runCLI)(argv, projects),
results = _ref.results,
globalConfig = _ref.globalConfig;
readResultsAndExit(results, globalConfig);
} catch (error) {
(0, _jestUtil().clearLine)(process.stderr);
(0, _jestUtil().clearLine)(process.stdout);
if (error.stack) {
console.error(_chalk().default.red(error.stack));
} else {
console.error(_chalk().default.red(error));
}
(0, _exit().default)(1);
throw error;
}
});
return _run.apply(this, arguments);
}
const buildArgv = maybeArgv => {
const version =
(0, _core().getVersion)() +
(__dirname.includes(`packages${_path().default.sep}jest-cli`)
? '-dev'
: '');
const rawArgv = maybeArgv || process.argv.slice(2);
const argv = (0, _yargs().default)(rawArgv)
.usage(args.usage)
.version(version)
.alias('help', 'h')
.options(args.options)
.epilogue(args.docs)
.check(args.check).argv;
(0, _jestValidate().validateCLIOptions)(
argv,
_objectSpread({}, args.options, {
deprecationEntries: _jestConfig().deprecationEntries
}), // strip leading dashes
Array.isArray(rawArgv)
? rawArgv.map(rawArgv => rawArgv.replace(/^--?/, ''))
: Object.keys(rawArgv)
); // strip dashed args
return Object.keys(argv).reduce((result, key) => {
if (!key.includes('-')) {
result[key] = argv[key];
}
return result;
}, {});
};
exports.buildArgv = buildArgv;
const getProjectListFromCLIArgs = (argv, project) => {
const projects = argv.projects ? argv.projects : [];
if (project) {
projects.push(project);
}
if (!projects.length && process.platform === 'win32') {
try {
projects.push((0, _realpathNative().sync)(process.cwd()));
} catch (err) {
// do nothing, just catch error
// process.binding('fs').realpath can throw, e.g. on mapped drives
}
}
if (!projects.length) {
projects.push(process.cwd());
}
return projects;
};
const readResultsAndExit = (result, globalConfig) => {
const code = !result || result.success ? 0 : globalConfig.testFailureExitCode; // Only exit if needed
process.on('exit', () => {
if (typeof code === 'number' && code !== 0) {
process.exitCode = code;
}
});
if (globalConfig.forceExit) {
if (!globalConfig.detectOpenHandles) {
console.warn(
_chalk().default.bold('Force exiting Jest: ') +
'Have you considered using `--detectOpenHandles` to detect ' +
'async operations that kept running after all tests finished?'
);
}
(0, _exit().default)(code);
} else if (!globalConfig.detectOpenHandles) {
setTimeout(() => {
console.warn(
_chalk().default.yellow.bold(
'Jest did not exit one second after the test run has completed.\n\n'
) +
_chalk().default.yellow(
'This usually means that there are asynchronous operations that ' +
"weren't stopped in your tests. Consider running Jest with " +
'`--detectOpenHandles` to troubleshoot this issue.'
)
);
}, 1000).unref();
}
};