mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
21
web/node_modules/jest-cli/LICENSE
generated
vendored
Normal file
21
web/node_modules/jest-cli/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
11
web/node_modules/jest-cli/README.md
generated
vendored
Normal file
11
web/node_modules/jest-cli/README.md
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Jest
|
||||
|
||||
🃏 Delightful JavaScript Testing
|
||||
|
||||
- **👩🏻💻 Developer Ready**: Complete and ready to set-up JavaScript testing solution. Works out of the box for any React project.
|
||||
|
||||
- **🏃🏽 Instant Feedback**: Failed tests run first. Fast interactive mode can switch between running all tests or only test files related to changed files.
|
||||
|
||||
- **📸 Snapshot Testing**: Jest can [capture snapshots](https://jestjs.io/docs/snapshot-testing.html) of React trees or other serializable values to simplify UI testing.
|
||||
|
||||
Read More: https://jestjs.io/
|
17
web/node_modules/jest-cli/bin/jest.js
generated
vendored
Executable file
17
web/node_modules/jest-cli/bin/jest.js
generated
vendored
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env node
|
||||
/**
|
||||
* 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 importLocal = require('import-local');
|
||||
|
||||
if (!importLocal(__filename)) {
|
||||
if (process.env.NODE_ENV == null) {
|
||||
process.env.NODE_ENV = 'test';
|
||||
}
|
||||
|
||||
require('../build/cli').run();
|
||||
}
|
506
web/node_modules/jest-cli/build/cli/args.d.ts
generated
vendored
Normal file
506
web/node_modules/jest-cli/build/cli/args.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,506 @@
|
|||
/**
|
||||
* 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 { Config } from '@jest/types';
|
||||
export declare function check(argv: Config.Argv): true;
|
||||
export declare const usage = "Usage: $0 [--config=<pathToConfigFile>] [TestPathPattern]";
|
||||
export declare const docs = "Documentation: https://jestjs.io/";
|
||||
export declare const options: {
|
||||
readonly all: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly automock: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Automock all files by default.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly bail: {
|
||||
readonly alias: "b";
|
||||
readonly default: undefined;
|
||||
readonly description: "Exit the test suite immediately after `n` number of failing tests.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly browser: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly cache: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly cacheDirectory: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly changedFilesWithAncestor: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly changedSince: {
|
||||
readonly description: string;
|
||||
readonly nargs: 1;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly ci: {
|
||||
readonly default: boolean;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly clearCache: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly clearMocks: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly collectCoverage: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Alias for --coverage.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly collectCoverageFrom: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly collectCoverageOnlyFrom: {
|
||||
readonly description: "Explicit list of paths coverage will be restricted to.";
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly color: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly colors: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Alias for `--color`.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly config: {
|
||||
readonly alias: "c";
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly coverage: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly coverageDirectory: {
|
||||
readonly description: "The directory where Jest should output its coverage files.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly coveragePathIgnorePatterns: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly coverageProvider: {
|
||||
readonly choices: readonly ["babel", "v8"];
|
||||
readonly description: "Select between Babel and V8 to collect coverage";
|
||||
};
|
||||
readonly coverageReporters: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly coverageThreshold: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly debug: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Print debugging info about your jest config.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly detectLeaks: {
|
||||
readonly default: false;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly detectOpenHandles: {
|
||||
readonly default: false;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly env: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly errorOnDeprecated: {
|
||||
readonly default: false;
|
||||
readonly description: "Make calling deprecated APIs throw helpful error messages.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly expand: {
|
||||
readonly alias: "e";
|
||||
readonly default: undefined;
|
||||
readonly description: "Use this flag to show full diffs instead of a patch.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly filter: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly findRelatedTests: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly forceExit: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly globalSetup: {
|
||||
readonly description: "The path to a module that runs before All Tests.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly globalTeardown: {
|
||||
readonly description: "The path to a module that runs after All Tests.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly globals: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly haste: {
|
||||
readonly description: "A JSON string with map of variables for the haste module system";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly init: {
|
||||
readonly description: "Generate a basic configuration file";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly injectGlobals: {
|
||||
readonly description: "Should Jest inject global variables or not";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly json: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly lastCommit: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly listTests: {
|
||||
readonly default: false;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly logHeapUsage: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly mapCoverage: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly maxConcurrency: {
|
||||
readonly default: 5;
|
||||
readonly description: string;
|
||||
readonly type: "number";
|
||||
};
|
||||
readonly maxWorkers: {
|
||||
readonly alias: "w";
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly moduleDirectories: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly moduleFileExtensions: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly moduleNameMapper: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly modulePathIgnorePatterns: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly modulePaths: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly noStackTrace: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Disables stack trace in test results output";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly notify: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Activates notifications for test results.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly notifyMode: {
|
||||
readonly default: "failure-change";
|
||||
readonly description: "Specifies when notifications will appear for test results.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly onlyChanged: {
|
||||
readonly alias: "o";
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly onlyFailures: {
|
||||
readonly alias: "f";
|
||||
readonly default: undefined;
|
||||
readonly description: "Run tests that failed in the previous execution.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly outputFile: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly passWithNoTests: {
|
||||
readonly default: false;
|
||||
readonly description: "Will not fail if no tests are found (for example while using `--testPathPattern`.)";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly preset: {
|
||||
readonly description: "A preset that is used as a base for Jest's configuration.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly prettierPath: {
|
||||
readonly default: undefined;
|
||||
readonly description: "The path to the \"prettier\" module used for inline snapshots.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly projects: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly reporters: {
|
||||
readonly description: "A list of custom reporters for the test suite.";
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly resetMocks: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly resetModules: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly resolver: {
|
||||
readonly description: "A JSON string which allows the use of a custom resolver.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly restoreMocks: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly rootDir: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly roots: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly runInBand: {
|
||||
readonly alias: "i";
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly runTestsByPath: {
|
||||
readonly default: false;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly runner: {
|
||||
readonly description: "Allows to use a custom runner instead of Jest's default test runner.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly selectProjects: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly setupFiles: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly setupFilesAfterEnv: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly showConfig: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Print your jest config and then exits.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly silent: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Prevent tests from printing messages through the console.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly skipFilter: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly snapshotSerializers: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly testEnvironment: {
|
||||
readonly description: "Alias for --env";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly testEnvironmentOptions: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly testFailureExitCode: {
|
||||
readonly description: "Exit code of `jest` command if the test run failed";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly testLocationInResults: {
|
||||
readonly default: false;
|
||||
readonly description: "Add `location` information to the test results";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly testMatch: {
|
||||
readonly description: "The glob patterns Jest uses to detect test files.";
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly testNamePattern: {
|
||||
readonly alias: "t";
|
||||
readonly description: "Run only tests with a name that matches the regex pattern.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly testPathIgnorePatterns: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly testPathPattern: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly testRegex: {
|
||||
readonly description: "A string or array of string regexp patterns that Jest uses to detect test files.";
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly testResultsProcessor: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly testRunner: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly testSequencer: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly testTimeout: {
|
||||
readonly description: "This option sets the default timeouts of test cases.";
|
||||
readonly type: "number";
|
||||
};
|
||||
readonly testURL: {
|
||||
readonly description: "This option sets the URL for the jsdom environment.";
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly timers: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly transform: {
|
||||
readonly description: string;
|
||||
readonly type: "string";
|
||||
};
|
||||
readonly transformIgnorePatterns: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly unmockedModulePathPatterns: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly updateSnapshot: {
|
||||
readonly alias: "u";
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly useStderr: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Divert all output to stderr.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly verbose: {
|
||||
readonly default: undefined;
|
||||
readonly description: "Display individual test results with the test suite hierarchy.";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly version: {
|
||||
readonly alias: "v";
|
||||
readonly default: undefined;
|
||||
readonly description: "Print the version and exit";
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly watch: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly watchAll: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
readonly watchPathIgnorePatterns: {
|
||||
readonly description: string;
|
||||
readonly string: true;
|
||||
readonly type: "array";
|
||||
};
|
||||
readonly watchman: {
|
||||
readonly default: undefined;
|
||||
readonly description: string;
|
||||
readonly type: "boolean";
|
||||
};
|
||||
};
|
786
web/node_modules/jest-cli/build/cli/args.js
generated
vendored
Normal file
786
web/node_modules/jest-cli/build/cli/args.js
generated
vendored
Normal file
|
@ -0,0 +1,786 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.check = check;
|
||||
exports.options = exports.docs = exports.usage = void 0;
|
||||
|
||||
function _isCi() {
|
||||
const data = _interopRequireDefault(require('is-ci'));
|
||||
|
||||
_isCi = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestConfig() {
|
||||
const data = require('jest-config');
|
||||
|
||||
_jestConfig = function () {
|
||||
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.
|
||||
*/
|
||||
function 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?'
|
||||
);
|
||||
}
|
||||
|
||||
for (const key of [
|
||||
'onlyChanged',
|
||||
'lastCommit',
|
||||
'changedFilesWithAncestor',
|
||||
'changedSince'
|
||||
]) {
|
||||
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.onlyFailures && argv.watchAll) {
|
||||
throw new Error(
|
||||
`Both --onlyFailures and --watchAll were specified, but these two ` +
|
||||
'options do not make sense together.'
|
||||
);
|
||||
}
|
||||
|
||||
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.selectProjects && argv.selectProjects.length === 0) {
|
||||
throw new Error(
|
||||
'The --selectProjects option requires the name of at least one project to be specified.\n' +
|
||||
'Example usage: jest --selectProjects my-first-project my-second-project'
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
argv.config &&
|
||||
!(0, _jestConfig().isJSONString)(argv.config) &&
|
||||
!argv.config.match(
|
||||
new RegExp(
|
||||
`\\.(${_jestConfig()
|
||||
.constants.JEST_CONFIG_EXT_ORDER.map(e => e.substring(1))
|
||||
.join('|')})$`,
|
||||
'i'
|
||||
)
|
||||
)
|
||||
) {
|
||||
throw new Error(
|
||||
`The --config option requires a JSON string literal, or a file path with one of these extensions: ${_jestConfig().constants.JEST_CONFIG_EXT_ORDER.join(
|
||||
', '
|
||||
)}.\nExample usage: jest --config ./jest.config.js`
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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'
|
||||
},
|
||||
coverageProvider: {
|
||||
choices: ['babel', 'v8'],
|
||||
description: 'Select between Babel and V8 to collect coverage'
|
||||
},
|
||||
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'
|
||||
},
|
||||
injectGlobals: {
|
||||
description: 'Should Jest inject global variables or not',
|
||||
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 or to arrays of 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'
|
||||
},
|
||||
selectProjects: {
|
||||
description:
|
||||
'Run only the tests of the specified projects.' +
|
||||
'Jest uses the attribute `displayName` in the configuration to identify each project.',
|
||||
string: true,
|
||||
type: 'array'
|
||||
},
|
||||
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;
|
9
web/node_modules/jest-cli/build/cli/index.d.ts
generated
vendored
Normal file
9
web/node_modules/jest-cli/build/cli/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* 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 { Config } from '@jest/types';
|
||||
export declare function run(maybeArgv?: Array<string>, project?: Config.Path): Promise<void>;
|
||||
export declare const buildArgv: (maybeArgv?: string[] | undefined) => Config.Argv;
|
273
web/node_modules/jest-cli/build/cli/index.js
generated
vendored
Normal file
273
web/node_modules/jest-cli/build/cli/index.js
generated
vendored
Normal file
|
@ -0,0 +1,273 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.run = run;
|
||||
exports.buildArgv = void 0;
|
||||
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _exit() {
|
||||
const data = _interopRequireDefault(require('exit'));
|
||||
|
||||
_exit = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _yargs() {
|
||||
const data = _interopRequireDefault(require('yargs'));
|
||||
|
||||
_yargs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _core() {
|
||||
const data = require('@jest/core');
|
||||
|
||||
_core = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestConfig() {
|
||||
const data = require('jest-config');
|
||||
|
||||
_jestConfig = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestValidate() {
|
||||
const data = require('jest-validate');
|
||||
|
||||
_jestValidate = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _init() {
|
||||
const data = _interopRequireDefault(require('../init'));
|
||||
|
||||
_init = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var args = _interopRequireWildcard(require('./args'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function () {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
async function run(maybeArgv, project) {
|
||||
try {
|
||||
const argv = buildArgv(maybeArgv);
|
||||
|
||||
if (argv.init) {
|
||||
await (0, _init().default)();
|
||||
return;
|
||||
}
|
||||
|
||||
const projects = getProjectListFromCLIArgs(argv, project);
|
||||
const {results, globalConfig} = await (0, _core().runCLI)(argv, projects);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
const buildArgv = maybeArgv => {
|
||||
const version =
|
||||
(0, _core().getVersion)() +
|
||||
(__dirname.includes(`packages${path().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,
|
||||
{...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;
|
||||
},
|
||||
{
|
||||
$0: argv.$0,
|
||||
_: argv._
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
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, _jestUtil().tryRealpath)(process.cwd()));
|
||||
} catch {
|
||||
// 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();
|
||||
}
|
||||
};
|
7
web/node_modules/jest-cli/build/index.d.ts
generated
vendored
Normal file
7
web/node_modules/jest-cli/build/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export { run } from './cli';
|
13
web/node_modules/jest-cli/build/index.js
generated
vendored
Normal file
13
web/node_modules/jest-cli/build/index.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'run', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _cli.run;
|
||||
}
|
||||
});
|
||||
|
||||
var _cli = require('./cli');
|
12
web/node_modules/jest-cli/build/init/errors.d.ts
generated
vendored
Normal file
12
web/node_modules/jest-cli/build/init/errors.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export declare class NotFoundPackageJsonError extends Error {
|
||||
constructor(rootDir: string);
|
||||
}
|
||||
export declare class MalformedPackageJsonError extends Error {
|
||||
constructor(packageJsonPath: string);
|
||||
}
|
35
web/node_modules/jest-cli/build/init/errors.js
generated
vendored
Normal file
35
web/node_modules/jest-cli/build/init/errors.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.MalformedPackageJsonError = exports.NotFoundPackageJsonError = void 0;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
class NotFoundPackageJsonError extends Error {
|
||||
constructor(rootDir) {
|
||||
super(`Could not find a "package.json" file in ${rootDir}`);
|
||||
this.name = '';
|
||||
Error.captureStackTrace(this, () => {});
|
||||
}
|
||||
}
|
||||
|
||||
exports.NotFoundPackageJsonError = NotFoundPackageJsonError;
|
||||
|
||||
class MalformedPackageJsonError extends Error {
|
||||
constructor(packageJsonPath) {
|
||||
super(
|
||||
`There is malformed json in ${packageJsonPath}\n` +
|
||||
'Fix it, and then run "jest --init"'
|
||||
);
|
||||
this.name = '';
|
||||
Error.captureStackTrace(this, () => {});
|
||||
}
|
||||
}
|
||||
|
||||
exports.MalformedPackageJsonError = MalformedPackageJsonError;
|
8
web/node_modules/jest-cli/build/init/generateConfigFile.d.ts
generated
vendored
Normal file
8
web/node_modules/jest-cli/build/init/generateConfigFile.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
declare const generateConfigFile: (results: Record<string, unknown>, generateEsm?: boolean) => string;
|
||||
export default generateConfigFile;
|
108
web/node_modules/jest-cli/build/init/generateConfigFile.js
generated
vendored
Normal file
108
web/node_modules/jest-cli/build/init/generateConfigFile.js
generated
vendored
Normal file
|
@ -0,0 +1,108 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _jestConfig() {
|
||||
const data = require('jest-config');
|
||||
|
||||
_jestConfig = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 stringifyOption = (option, map, linePrefix = '') => {
|
||||
const optionDescription = ` // ${_jestConfig().descriptions[option]}`;
|
||||
const stringifiedObject = `${option}: ${JSON.stringify(
|
||||
map[option],
|
||||
null,
|
||||
2
|
||||
)}`;
|
||||
return (
|
||||
optionDescription +
|
||||
'\n' +
|
||||
stringifiedObject
|
||||
.split('\n')
|
||||
.map(line => ' ' + linePrefix + line)
|
||||
.join('\n') +
|
||||
',\n'
|
||||
);
|
||||
};
|
||||
|
||||
const generateConfigFile = (results, generateEsm = false) => {
|
||||
const {
|
||||
useTypescript,
|
||||
coverage,
|
||||
coverageProvider,
|
||||
clearMocks,
|
||||
environment
|
||||
} = results;
|
||||
const overrides = {};
|
||||
|
||||
if (coverage) {
|
||||
Object.assign(overrides, {
|
||||
coverageDirectory: 'coverage'
|
||||
});
|
||||
}
|
||||
|
||||
if (coverageProvider === 'v8') {
|
||||
Object.assign(overrides, {
|
||||
coverageProvider: 'v8'
|
||||
});
|
||||
}
|
||||
|
||||
if (environment === 'node') {
|
||||
Object.assign(overrides, {
|
||||
testEnvironment: 'node'
|
||||
});
|
||||
}
|
||||
|
||||
if (clearMocks) {
|
||||
Object.assign(overrides, {
|
||||
clearMocks: true
|
||||
});
|
||||
}
|
||||
|
||||
const overrideKeys = Object.keys(overrides);
|
||||
const properties = [];
|
||||
|
||||
for (const option in _jestConfig().descriptions) {
|
||||
const opt = option;
|
||||
|
||||
if (overrideKeys.includes(opt)) {
|
||||
properties.push(stringifyOption(opt, overrides));
|
||||
} else {
|
||||
properties.push(stringifyOption(opt, _jestConfig().defaults, '// '));
|
||||
}
|
||||
}
|
||||
|
||||
const configHeaderMessage = `/*
|
||||
* For a detailed explanation regarding each configuration property${
|
||||
useTypescript ? ' and type check' : ''
|
||||
}, visit:
|
||||
* https://jestjs.io/docs/en/configuration.html
|
||||
*/
|
||||
|
||||
`;
|
||||
return (
|
||||
configHeaderMessage +
|
||||
(useTypescript || generateEsm
|
||||
? 'export default {\n'
|
||||
: 'module.exports = {\n') +
|
||||
properties.join('\n') +
|
||||
'};\n'
|
||||
);
|
||||
};
|
||||
|
||||
var _default = generateConfigFile;
|
||||
exports.default = _default;
|
8
web/node_modules/jest-cli/build/init/index.d.ts
generated
vendored
Normal file
8
web/node_modules/jest-cli/build/init/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
declare const _default: (rootDir?: string) => Promise<void>;
|
||||
export default _default;
|
250
web/node_modules/jest-cli/build/init/index.js
generated
vendored
Normal file
250
web/node_modules/jest-cli/build/init/index.js
generated
vendored
Normal file
|
@ -0,0 +1,250 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function fs() {
|
||||
const data = _interopRequireWildcard(require('graceful-fs'));
|
||||
|
||||
fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _prompts() {
|
||||
const data = _interopRequireDefault(require('prompts'));
|
||||
|
||||
_prompts = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestConfig() {
|
||||
const data = require('jest-config');
|
||||
|
||||
_jestConfig = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _errors = require('./errors');
|
||||
|
||||
var _generateConfigFile = _interopRequireDefault(
|
||||
require('./generateConfigFile')
|
||||
);
|
||||
|
||||
var _modifyPackageJson = _interopRequireDefault(require('./modifyPackageJson'));
|
||||
|
||||
var _questions = _interopRequireWildcard(require('./questions'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function () {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
JEST_CONFIG_BASE_NAME,
|
||||
JEST_CONFIG_EXT_MJS,
|
||||
JEST_CONFIG_EXT_JS,
|
||||
JEST_CONFIG_EXT_TS,
|
||||
JEST_CONFIG_EXT_ORDER,
|
||||
PACKAGE_JSON
|
||||
} = _jestConfig().constants;
|
||||
|
||||
const getConfigFilename = ext => JEST_CONFIG_BASE_NAME + ext;
|
||||
|
||||
var _default = async (
|
||||
rootDir = (0, _jestUtil().tryRealpath)(process.cwd())
|
||||
) => {
|
||||
// prerequisite checks
|
||||
const projectPackageJsonPath = path().join(rootDir, PACKAGE_JSON);
|
||||
|
||||
if (!fs().existsSync(projectPackageJsonPath)) {
|
||||
throw new _errors.NotFoundPackageJsonError(rootDir);
|
||||
}
|
||||
|
||||
const questions = _questions.default.slice(0);
|
||||
|
||||
let hasJestProperty = false;
|
||||
let projectPackageJson;
|
||||
|
||||
try {
|
||||
projectPackageJson = JSON.parse(
|
||||
fs().readFileSync(projectPackageJsonPath, 'utf-8')
|
||||
);
|
||||
} catch {
|
||||
throw new _errors.MalformedPackageJsonError(projectPackageJsonPath);
|
||||
}
|
||||
|
||||
if (projectPackageJson.jest) {
|
||||
hasJestProperty = true;
|
||||
}
|
||||
|
||||
const existingJestConfigExt = JEST_CONFIG_EXT_ORDER.find(ext =>
|
||||
fs().existsSync(path().join(rootDir, getConfigFilename(ext)))
|
||||
);
|
||||
|
||||
if (hasJestProperty || existingJestConfigExt) {
|
||||
const result = await (0, _prompts().default)({
|
||||
initial: true,
|
||||
message:
|
||||
'It seems that you already have a jest configuration, do you want to override it?',
|
||||
name: 'continue',
|
||||
type: 'confirm'
|
||||
});
|
||||
|
||||
if (!result.continue) {
|
||||
console.log();
|
||||
console.log('Aborting...');
|
||||
return;
|
||||
}
|
||||
} // Add test script installation only if needed
|
||||
|
||||
if (
|
||||
!projectPackageJson.scripts ||
|
||||
projectPackageJson.scripts.test !== 'jest'
|
||||
) {
|
||||
questions.unshift(_questions.testScriptQuestion);
|
||||
} // Start the init process
|
||||
|
||||
console.log();
|
||||
console.log(
|
||||
_chalk().default.underline(
|
||||
`The following questions will help Jest to create a suitable configuration for your project\n`
|
||||
)
|
||||
);
|
||||
let promptAborted = false; // @ts-expect-error: Return type cannot be object - faulty typings
|
||||
|
||||
const results = await (0, _prompts().default)(questions, {
|
||||
onCancel: () => {
|
||||
promptAborted = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (promptAborted) {
|
||||
console.log();
|
||||
console.log('Aborting...');
|
||||
return;
|
||||
} // Determine if Jest should use JS or TS for the config file
|
||||
|
||||
const jestConfigFileExt = results.useTypescript
|
||||
? JEST_CONFIG_EXT_TS
|
||||
: projectPackageJson.type === 'module'
|
||||
? JEST_CONFIG_EXT_MJS
|
||||
: JEST_CONFIG_EXT_JS; // Determine Jest config path
|
||||
|
||||
const jestConfigPath = existingJestConfigExt
|
||||
? getConfigFilename(existingJestConfigExt)
|
||||
: path().join(rootDir, getConfigFilename(jestConfigFileExt));
|
||||
const shouldModifyScripts = results.scripts;
|
||||
|
||||
if (shouldModifyScripts || hasJestProperty) {
|
||||
const modifiedPackageJson = (0, _modifyPackageJson.default)({
|
||||
projectPackageJson,
|
||||
shouldModifyScripts
|
||||
});
|
||||
fs().writeFileSync(projectPackageJsonPath, modifiedPackageJson);
|
||||
console.log('');
|
||||
console.log(
|
||||
`✏️ Modified ${_chalk().default.cyan(projectPackageJsonPath)}`
|
||||
);
|
||||
}
|
||||
|
||||
const generatedConfig = (0, _generateConfigFile.default)(
|
||||
results,
|
||||
projectPackageJson.type === 'module' ||
|
||||
jestConfigPath.endsWith(JEST_CONFIG_EXT_MJS)
|
||||
);
|
||||
fs().writeFileSync(jestConfigPath, generatedConfig);
|
||||
console.log('');
|
||||
console.log(
|
||||
`📝 Configuration file created at ${_chalk().default.cyan(jestConfigPath)}`
|
||||
);
|
||||
};
|
||||
|
||||
exports.default = _default;
|
12
web/node_modules/jest-cli/build/init/modifyPackageJson.d.ts
generated
vendored
Normal file
12
web/node_modules/jest-cli/build/init/modifyPackageJson.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* 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 { ProjectPackageJson } from './types';
|
||||
declare const modifyPackageJson: ({ projectPackageJson, shouldModifyScripts, }: {
|
||||
projectPackageJson: ProjectPackageJson;
|
||||
shouldModifyScripts: boolean;
|
||||
}) => string;
|
||||
export default modifyPackageJson;
|
28
web/node_modules/jest-cli/build/init/modifyPackageJson.js
generated
vendored
Normal file
28
web/node_modules/jest-cli/build/init/modifyPackageJson.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* 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 modifyPackageJson = ({projectPackageJson, shouldModifyScripts}) => {
|
||||
if (shouldModifyScripts) {
|
||||
projectPackageJson.scripts
|
||||
? (projectPackageJson.scripts.test = 'jest')
|
||||
: (projectPackageJson.scripts = {
|
||||
test: 'jest'
|
||||
});
|
||||
}
|
||||
|
||||
delete projectPackageJson.jest;
|
||||
return JSON.stringify(projectPackageJson, null, 2) + '\n';
|
||||
};
|
||||
|
||||
var _default = modifyPackageJson;
|
||||
exports.default = _default;
|
10
web/node_modules/jest-cli/build/init/questions.d.ts
generated
vendored
Normal file
10
web/node_modules/jest-cli/build/init/questions.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* 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 { PromptObject } from 'prompts';
|
||||
declare const defaultQuestions: Array<PromptObject>;
|
||||
export default defaultQuestions;
|
||||
export declare const testScriptQuestion: PromptObject;
|
75
web/node_modules/jest-cli/build/init/questions.js
generated
vendored
Normal file
75
web/node_modules/jest-cli/build/init/questions.js
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.testScriptQuestion = exports.default = void 0;
|
||||
|
||||
/**
|
||||
* 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 defaultQuestions = [
|
||||
{
|
||||
initial: false,
|
||||
message: 'Would you like to use Typescript for the configuration file?',
|
||||
name: 'useTypescript',
|
||||
type: 'confirm'
|
||||
},
|
||||
{
|
||||
choices: [
|
||||
{
|
||||
title: 'node',
|
||||
value: 'node'
|
||||
},
|
||||
{
|
||||
title: 'jsdom (browser-like)',
|
||||
value: 'jsdom'
|
||||
}
|
||||
],
|
||||
initial: 0,
|
||||
message: 'Choose the test environment that will be used for testing',
|
||||
name: 'environment',
|
||||
type: 'select'
|
||||
},
|
||||
{
|
||||
initial: false,
|
||||
message: 'Do you want Jest to add coverage reports?',
|
||||
name: 'coverage',
|
||||
type: 'confirm'
|
||||
},
|
||||
{
|
||||
choices: [
|
||||
{
|
||||
title: 'v8',
|
||||
value: 'v8'
|
||||
},
|
||||
{
|
||||
title: 'babel',
|
||||
value: 'babel'
|
||||
}
|
||||
],
|
||||
initial: 0,
|
||||
message: 'Which provider should be used to instrument code for coverage?',
|
||||
name: 'coverageProvider',
|
||||
type: 'select'
|
||||
},
|
||||
{
|
||||
initial: false,
|
||||
message: 'Automatically clear mock calls and instances between every test?',
|
||||
name: 'clearMocks',
|
||||
type: 'confirm'
|
||||
}
|
||||
];
|
||||
var _default = defaultQuestions;
|
||||
exports.default = _default;
|
||||
const testScriptQuestion = {
|
||||
initial: true,
|
||||
message:
|
||||
'Would you like to use Jest when running "test" script in "package.json"?',
|
||||
name: 'scripts',
|
||||
type: 'confirm'
|
||||
};
|
||||
exports.testScriptQuestion = testScriptQuestion;
|
12
web/node_modules/jest-cli/build/init/types.d.ts
generated
vendored
Normal file
12
web/node_modules/jest-cli/build/init/types.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* 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 { Config } from '@jest/types';
|
||||
export declare type ProjectPackageJson = {
|
||||
jest?: Partial<Config.InitialOptions>;
|
||||
scripts?: Record<string, string>;
|
||||
type?: 'commonjs' | 'module';
|
||||
};
|
1
web/node_modules/jest-cli/build/init/types.js
generated
vendored
Normal file
1
web/node_modules/jest-cli/build/init/types.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';
|
21
web/node_modules/jest-cli/node_modules/@jest/types/LICENSE
generated
vendored
Normal file
21
web/node_modules/jest-cli/node_modules/@jest/types/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
191
web/node_modules/jest-cli/node_modules/@jest/types/build/Circus.d.ts
generated
vendored
Normal file
191
web/node_modules/jest-cli/node_modules/@jest/types/build/Circus.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,191 @@
|
|||
/**
|
||||
* 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="node" />
|
||||
import type * as Global from './Global';
|
||||
declare type Process = NodeJS.Process;
|
||||
export declare type DoneFn = Global.DoneFn;
|
||||
export declare type BlockFn = Global.BlockFn;
|
||||
export declare type BlockName = Global.BlockName;
|
||||
export declare type BlockMode = void | 'skip' | 'only' | 'todo';
|
||||
export declare type TestMode = BlockMode;
|
||||
export declare type TestName = Global.TestName;
|
||||
export declare type TestFn = Global.TestFn;
|
||||
export declare type HookFn = Global.HookFn;
|
||||
export declare type AsyncFn = TestFn | HookFn;
|
||||
export declare type SharedHookType = 'afterAll' | 'beforeAll';
|
||||
export declare type HookType = SharedHookType | 'afterEach' | 'beforeEach';
|
||||
export declare type TestContext = Record<string, unknown>;
|
||||
export declare type Exception = any;
|
||||
export declare type FormattedError = string;
|
||||
export declare type Hook = {
|
||||
asyncError: Error;
|
||||
fn: HookFn;
|
||||
type: HookType;
|
||||
parent: DescribeBlock;
|
||||
timeout: number | undefined | null;
|
||||
};
|
||||
export interface EventHandler {
|
||||
(event: AsyncEvent, state: State): void | Promise<void>;
|
||||
(event: SyncEvent, state: State): void;
|
||||
}
|
||||
export declare type Event = SyncEvent | AsyncEvent;
|
||||
interface JestGlobals extends Global.TestFrameworkGlobals {
|
||||
expect: unknown;
|
||||
}
|
||||
export declare type SyncEvent = {
|
||||
asyncError: Error;
|
||||
mode: BlockMode;
|
||||
name: 'start_describe_definition';
|
||||
blockName: BlockName;
|
||||
} | {
|
||||
mode: BlockMode;
|
||||
name: 'finish_describe_definition';
|
||||
blockName: BlockName;
|
||||
} | {
|
||||
asyncError: Error;
|
||||
name: 'add_hook';
|
||||
hookType: HookType;
|
||||
fn: HookFn;
|
||||
timeout: number | undefined;
|
||||
} | {
|
||||
asyncError: Error;
|
||||
name: 'add_test';
|
||||
testName: TestName;
|
||||
fn: TestFn;
|
||||
mode?: TestMode;
|
||||
timeout: number | undefined;
|
||||
} | {
|
||||
name: 'error';
|
||||
error: Exception;
|
||||
};
|
||||
export declare type AsyncEvent = {
|
||||
name: 'setup';
|
||||
testNamePattern?: string;
|
||||
runtimeGlobals: JestGlobals;
|
||||
parentProcess: Process;
|
||||
} | {
|
||||
name: 'include_test_location_in_result';
|
||||
} | {
|
||||
name: 'hook_start';
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'hook_success';
|
||||
describeBlock?: DescribeBlock;
|
||||
test?: TestEntry;
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'hook_failure';
|
||||
error: string | Exception;
|
||||
describeBlock?: DescribeBlock;
|
||||
test?: TestEntry;
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'test_fn_start';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_fn_success';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_fn_failure';
|
||||
error: Exception;
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_retry';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_start';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_skip';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_todo';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_done';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'run_describe_start';
|
||||
describeBlock: DescribeBlock;
|
||||
} | {
|
||||
name: 'run_describe_finish';
|
||||
describeBlock: DescribeBlock;
|
||||
} | {
|
||||
name: 'run_start';
|
||||
} | {
|
||||
name: 'run_finish';
|
||||
} | {
|
||||
name: 'teardown';
|
||||
};
|
||||
export declare type MatcherResults = {
|
||||
actual: unknown;
|
||||
expected: unknown;
|
||||
name: string;
|
||||
pass: boolean;
|
||||
};
|
||||
export declare type TestStatus = 'skip' | 'done' | 'todo';
|
||||
export declare type TestResult = {
|
||||
duration?: number | null;
|
||||
errors: Array<FormattedError>;
|
||||
errorsDetailed: Array<MatcherResults | unknown>;
|
||||
invocations: number;
|
||||
status: TestStatus;
|
||||
location?: {
|
||||
column: number;
|
||||
line: number;
|
||||
} | null;
|
||||
testPath: Array<TestName | BlockName>;
|
||||
};
|
||||
export declare type RunResult = {
|
||||
unhandledErrors: Array<FormattedError>;
|
||||
testResults: TestResults;
|
||||
};
|
||||
export declare type TestResults = Array<TestResult>;
|
||||
export declare type GlobalErrorHandlers = {
|
||||
uncaughtException: Array<(exception: Exception) => void>;
|
||||
unhandledRejection: Array<(exception: Exception, promise: Promise<unknown>) => void>;
|
||||
};
|
||||
export declare type State = {
|
||||
currentDescribeBlock: DescribeBlock;
|
||||
currentlyRunningTest?: TestEntry | null;
|
||||
expand?: boolean;
|
||||
hasFocusedTests: boolean;
|
||||
hasStarted: boolean;
|
||||
originalGlobalErrorHandlers?: GlobalErrorHandlers;
|
||||
parentProcess: Process | null;
|
||||
rootDescribeBlock: DescribeBlock;
|
||||
testNamePattern?: RegExp | null;
|
||||
testTimeout: number;
|
||||
unhandledErrors: Array<Exception>;
|
||||
includeTestLocationInResult: boolean;
|
||||
};
|
||||
export declare type DescribeBlock = {
|
||||
type: 'describeBlock';
|
||||
children: Array<DescribeBlock | TestEntry>;
|
||||
hooks: Array<Hook>;
|
||||
mode: BlockMode;
|
||||
name: BlockName;
|
||||
parent?: DescribeBlock;
|
||||
/** @deprecated Please get from `children` array instead */
|
||||
tests: Array<TestEntry>;
|
||||
};
|
||||
export declare type TestError = Exception | [Exception | undefined, Exception];
|
||||
export declare type TestEntry = {
|
||||
type: 'test';
|
||||
asyncError: Exception;
|
||||
errors: Array<TestError>;
|
||||
fn: TestFn;
|
||||
invocations: number;
|
||||
mode: TestMode;
|
||||
name: TestName;
|
||||
parent: DescribeBlock;
|
||||
startedAt?: number | null;
|
||||
duration?: number | null;
|
||||
status?: TestStatus | null;
|
||||
timeout?: number;
|
||||
};
|
||||
export {};
|
1
web/node_modules/jest-cli/node_modules/@jest/types/build/Circus.js
generated
vendored
Normal file
1
web/node_modules/jest-cli/node_modules/@jest/types/build/Circus.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';
|
433
web/node_modules/jest-cli/node_modules/@jest/types/build/Config.d.ts
generated
vendored
Normal file
433
web/node_modules/jest-cli/node_modules/@jest/types/build/Config.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,433 @@
|
|||
/**
|
||||
* 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="node" />
|
||||
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<string>;
|
||||
/** Whether to throw on error on module collision. */
|
||||
throwOnModuleCollision?: boolean;
|
||||
};
|
||||
export declare type CoverageReporterName = keyof ReportOptions;
|
||||
export declare type CoverageReporterWithOptions<K = CoverageReporterName> = K extends CoverageReporterName ? ReportOptions[K] extends never ? never : [K, Partial<ReportOptions[K]>] : never;
|
||||
export declare type CoverageReporters = Array<CoverageReporterName | CoverageReporterWithOptions>;
|
||||
export declare type ReporterConfig = [string, Record<string, unknown>];
|
||||
export declare type TransformerConfig = [string, Record<string, unknown>];
|
||||
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<string>;
|
||||
coverageReporters: Array<CoverageReporterName>;
|
||||
coverageProvider: CoverageProvider;
|
||||
errorOnDeprecated: boolean;
|
||||
expand: boolean;
|
||||
forceCoverageMatch: Array<Glob>;
|
||||
globals: ConfigGlobals;
|
||||
haste: HasteConfig;
|
||||
injectGlobals: boolean;
|
||||
maxConcurrency: number;
|
||||
maxWorkers: number | string;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleNameMapper: Record<string, string | Array<string>>;
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: NotifyMode;
|
||||
prettierPath: string;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
restoreMocks: boolean;
|
||||
roots: Array<Path>;
|
||||
runTestsByPath: boolean;
|
||||
runner: 'jest-runner';
|
||||
setupFiles: Array<Path>;
|
||||
setupFilesAfterEnv: Array<Path>;
|
||||
skipFilter: boolean;
|
||||
slowTestThreshold: number;
|
||||
snapshotSerializers: Array<Path>;
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: Record<string, unknown>;
|
||||
testFailureExitCode: string | number;
|
||||
testLocationInResults: boolean;
|
||||
testMatch: Array<Glob>;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testRegex: Array<string>;
|
||||
testRunner: string;
|
||||
testSequencer: string;
|
||||
testURL: string;
|
||||
timers: Timers;
|
||||
transformIgnorePatterns: Array<Glob>;
|
||||
useStderr: boolean;
|
||||
watch: boolean;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
watchman: boolean;
|
||||
};
|
||||
export declare type DisplayName = {
|
||||
name: string;
|
||||
color: typeof ForegroundColor;
|
||||
};
|
||||
export declare type InitialOptionsWithRootDir = InitialOptions & Required<Pick<InitialOptions, 'rootDir'>>;
|
||||
export declare type InitialOptions = Partial<{
|
||||
automock: boolean;
|
||||
bail: boolean | number;
|
||||
cache: boolean;
|
||||
cacheDirectory: Path;
|
||||
clearMocks: boolean;
|
||||
changedFilesWithAncestor: boolean;
|
||||
changedSince: string;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: Array<Glob>;
|
||||
collectCoverageOnlyFrom: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
coverageDirectory: string;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
coverageProvider: CoverageProvider;
|
||||
coverageReporters: CoverageReporters;
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
[key: string]: number;
|
||||
};
|
||||
};
|
||||
dependencyExtractor: string;
|
||||
detectLeaks: boolean;
|
||||
detectOpenHandles: boolean;
|
||||
displayName: string | DisplayName;
|
||||
expand: boolean;
|
||||
extraGlobals: Array<string>;
|
||||
filter: Path;
|
||||
findRelatedTests: boolean;
|
||||
forceCoverageMatch: Array<Glob>;
|
||||
forceExit: boolean;
|
||||
json: boolean;
|
||||
globals: ConfigGlobals;
|
||||
globalSetup: string | null | undefined;
|
||||
globalTeardown: string | null | undefined;
|
||||
haste: HasteConfig;
|
||||
injectGlobals: boolean;
|
||||
reporters: Array<string | ReporterConfig>;
|
||||
logHeapUsage: boolean;
|
||||
lastCommit: boolean;
|
||||
listTests: boolean;
|
||||
mapCoverage: boolean;
|
||||
maxConcurrency: number;
|
||||
maxWorkers: number | string;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleLoader: Path;
|
||||
moduleNameMapper: {
|
||||
[key: string]: string | Array<string>;
|
||||
};
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
modulePaths: Array<string>;
|
||||
name: string;
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: string;
|
||||
onlyChanged: boolean;
|
||||
onlyFailures: boolean;
|
||||
outputFile: Path;
|
||||
passWithNoTests: boolean;
|
||||
preprocessorIgnorePatterns: Array<Glob>;
|
||||
preset: string | null | undefined;
|
||||
prettierPath: string | null | undefined;
|
||||
projects: Array<Glob>;
|
||||
replname: string | null | undefined;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver: Path | null | undefined;
|
||||
restoreMocks: boolean;
|
||||
rootDir: Path;
|
||||
roots: Array<Path>;
|
||||
runner: string;
|
||||
runTestsByPath: boolean;
|
||||
scriptPreprocessor: string;
|
||||
setupFiles: Array<Path>;
|
||||
setupTestFrameworkScriptFile: Path;
|
||||
setupFilesAfterEnv: Array<Path>;
|
||||
silent: boolean;
|
||||
skipFilter: boolean;
|
||||
skipNodeResolution: boolean;
|
||||
slowTestThreshold: number;
|
||||
snapshotResolver: Path;
|
||||
snapshotSerializers: Array<Path>;
|
||||
errorOnDeprecated: boolean;
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: Record<string, unknown>;
|
||||
testFailureExitCode: string | number;
|
||||
testLocationInResults: boolean;
|
||||
testMatch: Array<Glob>;
|
||||
testNamePattern: string;
|
||||
testPathDirs: Array<Path>;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testRegex: string | Array<string>;
|
||||
testResultsProcessor: string;
|
||||
testRunner: string;
|
||||
testSequencer: string;
|
||||
testURL: string;
|
||||
testTimeout: number;
|
||||
timers: Timers;
|
||||
transform: {
|
||||
[regex: string]: Path | TransformerConfig;
|
||||
};
|
||||
transformIgnorePatterns: Array<Glob>;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
unmockedModulePathPatterns: Array<string>;
|
||||
updateSnapshot: boolean;
|
||||
useStderr: boolean;
|
||||
verbose?: boolean;
|
||||
watch: boolean;
|
||||
watchAll: boolean;
|
||||
watchman: boolean;
|
||||
watchPlugins: Array<string | [string, Record<string, unknown>]>;
|
||||
}>;
|
||||
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<Glob>;
|
||||
collectCoverageOnlyFrom?: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
coverageDirectory: string;
|
||||
coveragePathIgnorePatterns?: Array<string>;
|
||||
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<string>;
|
||||
noSCM?: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: NotifyMode;
|
||||
outputFile?: Path;
|
||||
onlyChanged: boolean;
|
||||
onlyFailures: boolean;
|
||||
passWithNoTests: boolean;
|
||||
projects: Array<Glob>;
|
||||
replname?: string;
|
||||
reporters?: Array<string | ReporterConfig>;
|
||||
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<string, unknown>;
|
||||
}> | null;
|
||||
};
|
||||
export declare type ProjectConfig = {
|
||||
automock: boolean;
|
||||
cache: boolean;
|
||||
cacheDirectory: Path;
|
||||
clearMocks: boolean;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
cwd: Path;
|
||||
dependencyExtractor?: string;
|
||||
detectLeaks: boolean;
|
||||
detectOpenHandles: boolean;
|
||||
displayName?: DisplayName;
|
||||
errorOnDeprecated: boolean;
|
||||
extraGlobals: Array<keyof NodeJS.Global>;
|
||||
filter?: Path;
|
||||
forceCoverageMatch: Array<Glob>;
|
||||
globalSetup?: string;
|
||||
globalTeardown?: string;
|
||||
globals: ConfigGlobals;
|
||||
haste: HasteConfig;
|
||||
injectGlobals: boolean;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleLoader?: Path;
|
||||
moduleNameMapper: Array<[string, string]>;
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
modulePaths?: Array<string>;
|
||||
name: string;
|
||||
prettierPath: string;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver?: Path;
|
||||
restoreMocks: boolean;
|
||||
rootDir: Path;
|
||||
roots: Array<Path>;
|
||||
runner: string;
|
||||
setupFiles: Array<Path>;
|
||||
setupFilesAfterEnv: Array<Path>;
|
||||
skipFilter: boolean;
|
||||
skipNodeResolution?: boolean;
|
||||
slowTestThreshold: number;
|
||||
snapshotResolver?: Path;
|
||||
snapshotSerializers: Array<Path>;
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: Record<string, unknown>;
|
||||
testMatch: Array<Glob>;
|
||||
testLocationInResults: boolean;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testRegex: Array<string | RegExp>;
|
||||
testRunner: string;
|
||||
testURL: string;
|
||||
timers: Timers;
|
||||
transform: Array<[string, Path, Record<string, unknown>]>;
|
||||
transformIgnorePatterns: Array<Glob>;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
unmockedModulePathPatterns?: Array<string>;
|
||||
};
|
||||
export declare type Argv = Arguments<Partial<{
|
||||
all: boolean;
|
||||
automock: boolean;
|
||||
bail: boolean | number;
|
||||
cache: boolean;
|
||||
cacheDirectory: string;
|
||||
changedFilesWithAncestor: boolean;
|
||||
changedSince: string;
|
||||
ci: boolean;
|
||||
clearCache: boolean;
|
||||
clearMocks: boolean;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: string;
|
||||
collectCoverageOnlyFrom: Array<string>;
|
||||
color: boolean;
|
||||
colors: boolean;
|
||||
config: string;
|
||||
coverage: boolean;
|
||||
coverageDirectory: string;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
coverageReporters: Array<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;
|
||||
injectGlobals: boolean;
|
||||
json: boolean;
|
||||
lastCommit: boolean;
|
||||
logHeapUsage: boolean;
|
||||
maxWorkers: number | string;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleNameMapper: string;
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
modulePaths: Array<string>;
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: string;
|
||||
onlyChanged: boolean;
|
||||
onlyFailures: boolean;
|
||||
outputFile: string;
|
||||
preset: string | null | undefined;
|
||||
projects: Array<string>;
|
||||
prettierPath: string | null | undefined;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver: string | null | undefined;
|
||||
restoreMocks: boolean;
|
||||
rootDir: string;
|
||||
roots: Array<string>;
|
||||
runInBand: boolean;
|
||||
selectProjects: Array<string>;
|
||||
setupFiles: Array<string>;
|
||||
setupFilesAfterEnv: Array<string>;
|
||||
showConfig: boolean;
|
||||
silent: boolean;
|
||||
snapshotSerializers: Array<string>;
|
||||
testEnvironment: string;
|
||||
testFailureExitCode: string | null | undefined;
|
||||
testMatch: Array<string>;
|
||||
testNamePattern: string;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testPathPattern: Array<string>;
|
||||
testRegex: string | Array<string>;
|
||||
testResultsProcessor: string;
|
||||
testRunner: string;
|
||||
testSequencer: string;
|
||||
testURL: string;
|
||||
testTimeout: number | null | undefined;
|
||||
timers: string;
|
||||
transform: string;
|
||||
transformIgnorePatterns: Array<string>;
|
||||
unmockedModulePathPatterns: Array<string> | null | undefined;
|
||||
updateSnapshot: boolean;
|
||||
useStderr: boolean;
|
||||
verbose: boolean;
|
||||
version: boolean;
|
||||
watch: boolean;
|
||||
watchAll: boolean;
|
||||
watchman: boolean;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
}>>;
|
||||
export {};
|
1
web/node_modules/jest-cli/node_modules/@jest/types/build/Config.js
generated
vendored
Normal file
1
web/node_modules/jest-cli/node_modules/@jest/types/build/Config.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';
|
88
web/node_modules/jest-cli/node_modules/@jest/types/build/Global.d.ts
generated
vendored
Normal file
88
web/node_modules/jest-cli/node_modules/@jest/types/build/Global.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,88 @@
|
|||
/**
|
||||
* 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="node" />
|
||||
import type { CoverageMapData } from 'istanbul-lib-coverage';
|
||||
export declare type DoneFn = (reason?: string | Error) => void;
|
||||
export declare type TestName = string;
|
||||
export declare type TestFn = (done?: DoneFn) => Promise<void | undefined | unknown> | void | undefined;
|
||||
export declare type ConcurrentTestFn = (done?: DoneFn) => Promise<void | undefined | unknown>;
|
||||
export declare type BlockFn = () => void;
|
||||
export declare type BlockName = string;
|
||||
export declare type HookFn = TestFn;
|
||||
export declare type Col = unknown;
|
||||
export declare type Row = Array<Col>;
|
||||
export declare type Table = Array<Row>;
|
||||
export declare type ArrayTable = Table | Row;
|
||||
export declare type TemplateTable = TemplateStringsArray;
|
||||
export declare type TemplateData = Array<unknown>;
|
||||
export declare type EachTable = ArrayTable | TemplateTable;
|
||||
export declare type TestCallback = BlockFn | TestFn | ConcurrentTestFn;
|
||||
export declare type EachTestFn<EachCallback extends TestCallback> = (...args: Array<any>) => ReturnType<EachCallback>;
|
||||
declare type Jasmine = {
|
||||
_DEFAULT_TIMEOUT_INTERVAL?: number;
|
||||
addMatchers: (matchers: Record<string, unknown>) => void;
|
||||
};
|
||||
declare type Each<EachCallback extends TestCallback> = ((table: EachTable, ...taggedTemplateData: Array<unknown>) => (title: string, test: EachTestFn<EachCallback>, timeout?: number) => void) | (() => () => void);
|
||||
export interface HookBase {
|
||||
(fn: HookFn, timeout?: number): void;
|
||||
}
|
||||
export interface ItBase {
|
||||
(testName: TestName, fn: TestFn, timeout?: number): void;
|
||||
each: Each<TestFn>;
|
||||
}
|
||||
export interface It extends ItBase {
|
||||
only: ItBase;
|
||||
skip: ItBase;
|
||||
todo: (testName: TestName) => void;
|
||||
}
|
||||
export interface ItConcurrentBase {
|
||||
(testName: string, testFn: ConcurrentTestFn, timeout?: number): void;
|
||||
each: Each<ConcurrentTestFn>;
|
||||
}
|
||||
export interface ItConcurrentExtended extends ItConcurrentBase {
|
||||
only: ItConcurrentBase;
|
||||
skip: ItConcurrentBase;
|
||||
}
|
||||
export interface ItConcurrent extends It {
|
||||
concurrent: ItConcurrentExtended;
|
||||
}
|
||||
export interface DescribeBase {
|
||||
(blockName: BlockName, blockFn: BlockFn): void;
|
||||
each: Each<BlockFn>;
|
||||
}
|
||||
export interface Describe extends DescribeBase {
|
||||
only: DescribeBase;
|
||||
skip: DescribeBase;
|
||||
}
|
||||
export interface TestFrameworkGlobals {
|
||||
it: ItConcurrent;
|
||||
test: ItConcurrent;
|
||||
fit: ItBase & {
|
||||
concurrent?: ItConcurrentBase;
|
||||
};
|
||||
xit: ItBase;
|
||||
xtest: ItBase;
|
||||
describe: Describe;
|
||||
xdescribe: DescribeBase;
|
||||
fdescribe: DescribeBase;
|
||||
beforeAll: HookBase;
|
||||
beforeEach: HookBase;
|
||||
afterEach: HookBase;
|
||||
afterAll: HookBase;
|
||||
}
|
||||
export interface GlobalAdditions extends TestFrameworkGlobals {
|
||||
__coverage__: CoverageMapData;
|
||||
jasmine: Jasmine;
|
||||
fail: () => void;
|
||||
pending: () => void;
|
||||
spyOn: () => void;
|
||||
spyOnProperty: () => void;
|
||||
}
|
||||
export interface Global extends GlobalAdditions, Omit<NodeJS.Global, keyof GlobalAdditions> {
|
||||
[extras: string]: unknown;
|
||||
}
|
||||
export {};
|
1
web/node_modules/jest-cli/node_modules/@jest/types/build/Global.js
generated
vendored
Normal file
1
web/node_modules/jest-cli/node_modules/@jest/types/build/Global.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';
|
31
web/node_modules/jest-cli/node_modules/@jest/types/build/TestResult.d.ts
generated
vendored
Normal file
31
web/node_modules/jest-cli/node_modules/@jest/types/build/TestResult.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export declare type Milliseconds = number;
|
||||
declare type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'todo' | 'disabled';
|
||||
declare type Callsite = {
|
||||
column: number;
|
||||
line: number;
|
||||
};
|
||||
export declare type AssertionResult = {
|
||||
ancestorTitles: Array<string>;
|
||||
duration?: Milliseconds | null;
|
||||
failureDetails: Array<unknown>;
|
||||
failureMessages: Array<string>;
|
||||
fullName: string;
|
||||
invocations?: number;
|
||||
location?: Callsite | null;
|
||||
numPassingAsserts: number;
|
||||
status: Status;
|
||||
title: string;
|
||||
};
|
||||
export declare type SerializableError = {
|
||||
code?: unknown;
|
||||
message: string;
|
||||
stack: string | null | undefined;
|
||||
type?: string;
|
||||
};
|
||||
export {};
|
1
web/node_modules/jest-cli/node_modules/@jest/types/build/TestResult.js
generated
vendored
Normal file
1
web/node_modules/jest-cli/node_modules/@jest/types/build/TestResult.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';
|
12
web/node_modules/jest-cli/node_modules/@jest/types/build/Transform.d.ts
generated
vendored
Normal file
12
web/node_modules/jest-cli/node_modules/@jest/types/build/Transform.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export declare type TransformResult = {
|
||||
code: string;
|
||||
originalCode: string;
|
||||
mapCoverage?: boolean;
|
||||
sourceMapPath: string | null;
|
||||
};
|
1
web/node_modules/jest-cli/node_modules/@jest/types/build/Transform.js
generated
vendored
Normal file
1
web/node_modules/jest-cli/node_modules/@jest/types/build/Transform.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';
|
12
web/node_modules/jest-cli/node_modules/@jest/types/build/index.d.ts
generated
vendored
Normal file
12
web/node_modules/jest-cli/node_modules/@jest/types/build/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* 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 * as Circus from './Circus';
|
||||
import type * as Config from './Config';
|
||||
import type * as Global from './Global';
|
||||
import type * as TestResult from './TestResult';
|
||||
import type * as TransformTypes from './Transform';
|
||||
export type { Circus, Config, Global, TestResult, TransformTypes };
|
1
web/node_modules/jest-cli/node_modules/@jest/types/build/index.js
generated
vendored
Normal file
1
web/node_modules/jest-cli/node_modules/@jest/types/build/index.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';
|
26
web/node_modules/jest-cli/node_modules/@jest/types/package.json
generated
vendored
Normal file
26
web/node_modules/jest-cli/node_modules/@jest/types/package.json
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "@jest/types",
|
||||
"version": "26.6.2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-types"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.14.2"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@types/istanbul-lib-coverage": "^2.0.0",
|
||||
"@types/istanbul-reports": "^3.0.0",
|
||||
"@types/node": "*",
|
||||
"@types/yargs": "^15.0.0",
|
||||
"chalk": "^4.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "4c46930615602cbf983fb7e8e82884c282a624d5"
|
||||
}
|
21
web/node_modules/jest-cli/node_modules/@types/yargs/LICENSE
generated
vendored
Executable file
21
web/node_modules/jest-cli/node_modules/@types/yargs/LICENSE
generated
vendored
Executable file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
16
web/node_modules/jest-cli/node_modules/@types/yargs/README.md
generated
vendored
Executable file
16
web/node_modules/jest-cli/node_modules/@types/yargs/README.md
generated
vendored
Executable file
|
@ -0,0 +1,16 @@
|
|||
# Installation
|
||||
> `npm install --save @types/yargs`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for yargs (https://github.com/chevex/yargs).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs/v15.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Fri, 02 Jul 2021 16:32:05 GMT
|
||||
* Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser)
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Martin Poelstra](https://github.com/poelstra), [Mizunashi Mana](https://github.com/mizunashi-mana), [Jeffery Grajkowski](https://github.com/pushplay), [Jimi (Dimitris) Charalampidis](https://github.com/JimiC), [Steffen Viken Valvåg](https://github.com/steffenvv), [Emily Marigold Klassen](https://github.com/forivall), [ExE Boss](https://github.com/ExE-Boss), and [Aankhen](https://github.com/Aankhen).
|
836
web/node_modules/jest-cli/node_modules/@types/yargs/index.d.ts
generated
vendored
Executable file
836
web/node_modules/jest-cli/node_modules/@types/yargs/index.d.ts
generated
vendored
Executable file
|
@ -0,0 +1,836 @@
|
|||
// Type definitions for yargs 15.0
|
||||
// Project: https://github.com/chevex/yargs, https://yargs.js.org
|
||||
// Definitions by: Martin Poelstra <https://github.com/poelstra>
|
||||
// Mizunashi Mana <https://github.com/mizunashi-mana>
|
||||
// Jeffery Grajkowski <https://github.com/pushplay>
|
||||
// Jimi (Dimitris) Charalampidis <https://github.com/JimiC>
|
||||
// Steffen Viken Valvåg <https://github.com/steffenvv>
|
||||
// Emily Marigold Klassen <https://github.com/forivall>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Aankhen <https://github.com/Aankhen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
// The following TSLint rules have been disabled:
|
||||
// unified-signatures: Because there is useful information in the argument names of the overloaded signatures
|
||||
|
||||
// Convention:
|
||||
// Use 'union types' when:
|
||||
// - parameter types have similar signature type (i.e. 'string | ReadonlyArray<string>')
|
||||
// - parameter names have the same semantic meaning (i.e. ['command', 'commands'] , ['key', 'keys'])
|
||||
// An example for not using 'union types' is the declaration of 'env' where `prefix` and `enable` parameters
|
||||
// have different semantics. On the other hand, in the declaration of 'usage', a `command: string` parameter
|
||||
// has the same semantic meaning with declaring an overload method by using `commands: ReadonlyArray<string>`,
|
||||
// thus it's preferred to use `command: string | ReadonlyArray<string>`
|
||||
// Use parameterless declaration instead of declaring all parameters optional,
|
||||
// when all parameters are optional and more than one
|
||||
|
||||
import { DetailedArguments, Configuration } from 'yargs-parser';
|
||||
|
||||
declare namespace yargs {
|
||||
type BuilderCallback<T, R> = ((args: Argv<T>) => PromiseLike<Argv<R>>) | ((args: Argv<T>) => Argv<R>) | ((args: Argv<T>) => void);
|
||||
|
||||
type ParserConfigurationOptions = Configuration & {
|
||||
/** Sort commands alphabetically. Default is `false` */
|
||||
'sort-commands': boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* The type parameter `T` is the expected shape of the parsed options.
|
||||
* `Arguments<T>` is those options plus `_` and `$0`, and an indexer falling
|
||||
* back to `unknown` for unknown options.
|
||||
*
|
||||
* For the return type / `argv` property, we create a mapped type over
|
||||
* `Arguments<T>` to simplify the inferred type signature in client code.
|
||||
*/
|
||||
interface Argv<T = {}> {
|
||||
(): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
(args: ReadonlyArray<string>, cwd?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Set key names as equivalent such that updates to a key will propagate to aliases and vice-versa.
|
||||
*
|
||||
* Optionally `.alias()` can take an object that maps keys to aliases.
|
||||
* Each key of this object should be the canonical version of the option, and each value should be a string or an array of strings.
|
||||
*/
|
||||
// Aliases for previously declared options can inherit the types of those options.
|
||||
alias<K1 extends keyof T, K2 extends string>(shortName: K1, longName: K2 | ReadonlyArray<K2>): Argv<T & { [key in K2]: T[K1] }>;
|
||||
alias<K1 extends keyof T, K2 extends string>(shortName: K2, longName: K1 | ReadonlyArray<K1>): Argv<T & { [key in K2]: T[K1] }>;
|
||||
alias(shortName: string | ReadonlyArray<string>, longName: string | ReadonlyArray<string>): Argv<T>;
|
||||
alias(aliases: { [shortName: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Get the arguments as a plain old object.
|
||||
*
|
||||
* Arguments without a corresponding flag show up in the `argv._` array.
|
||||
*
|
||||
* The script name or node command is available at `argv.$0` similarly to how `$0` works in bash or perl.
|
||||
*
|
||||
* If `yargs` is executed in an environment that embeds node and there's no script name (e.g. Electron or nw.js),
|
||||
* it will ignore the first parameter since it expects it to be the script name. In order to override
|
||||
* this behavior, use `.parse(process.argv.slice(1))` instead of .argv and the first parameter won't be ignored.
|
||||
*/
|
||||
argv: { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
|
||||
/**
|
||||
* Tell the parser to interpret `key` as an array.
|
||||
* If `.array('foo')` is set, `--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`.
|
||||
* Also, if you use the option multiple times all the values will be flattened in one array so `--foo foo --foo bar` will be parsed as `['foo', 'bar']`
|
||||
*
|
||||
* When the option is used with a positional, use `--` to tell `yargs` to stop adding values to the array.
|
||||
*/
|
||||
array<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToArray<T[key]> }>;
|
||||
array<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: Array<string | number> | undefined }>;
|
||||
|
||||
/**
|
||||
* Interpret `key` as a boolean. If a non-flag option follows `key` in `process.argv`, that string won't get set as the value of `key`.
|
||||
*
|
||||
* `key` will default to `false`, unless a `default(key, undefined)` is explicitly set.
|
||||
*
|
||||
* If `key` is an array, interpret all the elements as booleans.
|
||||
*/
|
||||
boolean<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: boolean | undefined }>;
|
||||
boolean<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: boolean | undefined }>;
|
||||
|
||||
/**
|
||||
* Check that certain conditions are met in the provided arguments.
|
||||
* @param func Called with two arguments, the parsed `argv` hash and an array of options and their aliases.
|
||||
* If `func` throws or returns a non-truthy value, show the thrown error, usage information, and exit.
|
||||
* @param global Indicates whether `check()` should be enabled both at the top-level and for each sub-command.
|
||||
*/
|
||||
check(func: (argv: Arguments<T>, aliases: { [alias: string]: string }) => any, global?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Limit valid values for key to a predefined set of choices, given as an array or as an individual value.
|
||||
* If this method is called multiple times, all enumerated values will be merged together.
|
||||
* Choices are generally strings or numbers, and value matching is case-sensitive.
|
||||
*
|
||||
* Optionally `.choices()` can take an object that maps multiple keys to their choices.
|
||||
*
|
||||
* Choices can also be specified as choices in the object given to `option()`.
|
||||
*/
|
||||
choices<K extends keyof T, C extends ReadonlyArray<any>>(key: K, values: C): Argv<Omit<T, K> & { [key in K]: C[number] | undefined }>;
|
||||
choices<K extends string, C extends ReadonlyArray<any>>(key: K, values: C): Argv<T & { [key in K]: C[number] | undefined }>;
|
||||
choices<C extends { [key: string]: ReadonlyArray<any> }>(choices: C): Argv<Omit<T, keyof C> & { [key in keyof C]: C[key][number] | undefined }>;
|
||||
|
||||
/**
|
||||
* Provide a synchronous function to coerce or transform the value(s) given on the command line for `key`.
|
||||
*
|
||||
* The coercion function should accept one argument, representing the parsed value from the command line, and should return a new value or throw an error.
|
||||
* The returned value will be used as the value for `key` (or one of its aliases) in `argv`.
|
||||
*
|
||||
* If the function throws, the error will be treated as a validation failure, delegating to either a custom `.fail()` handler or printing the error message in the console.
|
||||
*
|
||||
* Coercion will be applied to a value after all other modifications, such as `.normalize()`.
|
||||
*
|
||||
* Optionally `.coerce()` can take an object that maps several keys to their respective coercion function.
|
||||
*
|
||||
* You can also map the same function to several keys at one time. Just pass an array of keys as the first argument to `.coerce()`.
|
||||
*
|
||||
* If you are using dot-notion or arrays, .e.g., `user.email` and `user.password`, coercion will be applied to the final object that has been parsed
|
||||
*/
|
||||
coerce<K extends keyof T, V>(key: K | ReadonlyArray<K>, func: (arg: any) => V): Argv<Omit<T, K> & { [key in K]: V | undefined }>;
|
||||
coerce<K extends string, V>(key: K | ReadonlyArray<K>, func: (arg: any) => V): Argv<T & { [key in K]: V | undefined }>;
|
||||
coerce<O extends { [key: string]: (arg: any) => any }>(opts: O): Argv<Omit<T, keyof O> & { [key in keyof O]: ReturnType<O[key]> | undefined }>;
|
||||
|
||||
/**
|
||||
* Define the commands exposed by your application.
|
||||
* @param command Should be a string representing the command or an array of strings representing the command and its aliases.
|
||||
* @param description Use to provide a description for each command your application accepts (the values stored in `argv._`).
|
||||
* Set `description` to false to create a hidden command. Hidden commands don't show up in the help output and aren't available for completion.
|
||||
* @param [builder] Object to give hints about the options that your command accepts.
|
||||
* Can also be a function. This function is executed with a yargs instance, and can be used to provide advanced command specific help.
|
||||
*
|
||||
* Note that when `void` is returned, the handler `argv` object type will not include command-specific arguments.
|
||||
* @param [handler] Function, which will be executed with the parsed `argv` object.
|
||||
*/
|
||||
command<U = T>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
description: string,
|
||||
builder?: BuilderCallback<T, U>,
|
||||
handler?: (args: Arguments<U>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<U>;
|
||||
command<O extends { [key: string]: Options }>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
description: string,
|
||||
builder?: O,
|
||||
handler?: (args: Arguments<InferredOptionTypes<O>>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<T>;
|
||||
command<U>(command: string | ReadonlyArray<string>, description: string, module: CommandModule<T, U>): Argv<U>;
|
||||
command<U = T>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
showInHelp: false,
|
||||
builder?: BuilderCallback<T, U>,
|
||||
handler?: (args: Arguments<U>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<T>;
|
||||
command<O extends { [key: string]: Options }>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
showInHelp: false,
|
||||
builder?: O,
|
||||
handler?: (args: Arguments<InferredOptionTypes<O>>) => void,
|
||||
): Argv<T>;
|
||||
command<U>(command: string | ReadonlyArray<string>, showInHelp: false, module: CommandModule<T, U>): Argv<U>;
|
||||
command<U>(module: CommandModule<T, U>): Argv<U>;
|
||||
|
||||
// Advanced API
|
||||
/** Apply command modules from a directory relative to the module calling this method. */
|
||||
commandDir(dir: string, opts?: RequireDirectoryOptions): Argv<T>;
|
||||
|
||||
/**
|
||||
* Enable bash/zsh-completion shortcuts for commands and options.
|
||||
*
|
||||
* If invoked without parameters, `.completion()` will make completion the command to output the completion script.
|
||||
*
|
||||
* @param [cmd] When present in `argv._`, will result in the `.bashrc` or `.zshrc` completion script being outputted.
|
||||
* To enable bash/zsh completions, concat the generated script to your `.bashrc` or `.bash_profile` (or `.zshrc` for zsh).
|
||||
* @param [description] Provide a description in your usage instructions for the command that generates the completion scripts.
|
||||
* @param [func] Rather than relying on yargs' default completion functionality, which shiver me timbers is pretty awesome, you can provide your own completion method.
|
||||
*/
|
||||
completion(): Argv<T>;
|
||||
completion(cmd: string, func?: AsyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, func?: SyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, func?: PromiseCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: AsyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: SyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: PromiseCompletionFunction): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tells the parser that if the option specified by `key` is passed in, it should be interpreted as a path to a JSON config file.
|
||||
* The file is loaded and parsed, and its properties are set as arguments.
|
||||
* Because the file is loaded using Node's require(), the filename MUST end in `.json` to be interpreted correctly.
|
||||
*
|
||||
* If invoked without parameters, `.config()` will make --config the option to pass the JSON config file.
|
||||
*
|
||||
* @param [description] Provided to customize the config (`key`) option in the usage string.
|
||||
* @param [explicitConfigurationObject] An explicit configuration `object`
|
||||
*/
|
||||
config(): Argv<T>;
|
||||
config(key: string | ReadonlyArray<string>, description?: string, parseFn?: (configPath: string) => object): Argv<T>;
|
||||
config(key: string | ReadonlyArray<string>, parseFn: (configPath: string) => object): Argv<T>;
|
||||
config(explicitConfigurationObject: object): Argv<T>;
|
||||
|
||||
/**
|
||||
* Given the key `x` is set, the key `y` must not be set. `y` can either be a single string or an array of argument names that `x` conflicts with.
|
||||
*
|
||||
* Optionally `.conflicts()` can accept an object specifying multiple conflicting keys.
|
||||
*/
|
||||
conflicts(key: string, value: string | ReadonlyArray<string>): Argv<T>;
|
||||
conflicts(conflicts: { [key: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Interpret `key` as a boolean flag, but set its parsed value to the number of flag occurrences rather than `true` or `false`. Default value is thus `0`.
|
||||
*/
|
||||
count<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: number }>;
|
||||
count<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number }>;
|
||||
|
||||
/**
|
||||
* Set `argv[key]` to `value` if no option was specified in `process.argv`.
|
||||
*
|
||||
* Optionally `.default()` can take an object that maps keys to default values.
|
||||
*
|
||||
* The default value can be a `function` which returns a value. The name of the function will be used in the usage string.
|
||||
*
|
||||
* Optionally, `description` can also be provided and will take precedence over displaying the value in the usage instructions.
|
||||
*/
|
||||
default<K extends keyof T, V>(key: K, value: V, description?: string): Argv<Omit<T, K> & { [key in K]: V }>;
|
||||
default<K extends string, V>(key: K, value: V, description?: string): Argv<T & { [key in K]: V }>;
|
||||
default<D extends { [key: string]: any }>(defaults: D, description?: string): Argv<Omit<T, keyof D> & D>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
demand<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
demand<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>;
|
||||
demand(key: string | ReadonlyArray<string>, required?: boolean): Argv<T>;
|
||||
demand(positionals: number, msg: string): Argv<T>;
|
||||
demand(positionals: number, required?: boolean): Argv<T>;
|
||||
demand(positionals: number, max: number, msg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* @param key If is a string, show the usage information and exit if key wasn't specified in `process.argv`.
|
||||
* If is an array, demand each element.
|
||||
* @param msg If string is given, it will be printed when the argument is missing, instead of the standard error message.
|
||||
* @param demand Controls whether the option is demanded; this is useful when using .options() to specify command line parameters.
|
||||
*/
|
||||
demandOption<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
demandOption<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>;
|
||||
demandOption(key: string | ReadonlyArray<string>, demand?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Demand in context of commands.
|
||||
* You can demand a minimum and a maximum number a user can have within your program, as well as provide corresponding error messages if either of the demands is not met.
|
||||
*/
|
||||
demandCommand(): Argv<T>;
|
||||
demandCommand(min: number, minMsg?: string): Argv<T>;
|
||||
demandCommand(min: number, max?: number, minMsg?: string, maxMsg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Shows a [deprecated] notice in front of the option
|
||||
*/
|
||||
deprecateOption(option: string, msg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Describe a `key` for the generated usage information.
|
||||
*
|
||||
* Optionally `.describe()` can take an object that maps keys to descriptions.
|
||||
*/
|
||||
describe(key: string | ReadonlyArray<string>, description: string): Argv<T>;
|
||||
describe(descriptions: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/** Should yargs attempt to detect the os' locale? Defaults to `true`. */
|
||||
detectLocale(detect: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tell yargs to parse environment variables matching the given prefix and apply them to argv as though they were command line arguments.
|
||||
*
|
||||
* Use the "__" separator in the environment variable to indicate nested options. (e.g. prefix_nested__foo => nested.foo)
|
||||
*
|
||||
* If this method is called with no argument or with an empty string or with true, then all env vars will be applied to argv.
|
||||
*
|
||||
* Program arguments are defined in this order of precedence:
|
||||
* 1. Command line args
|
||||
* 2. Env vars
|
||||
* 3. Config file/objects
|
||||
* 4. Configured defaults
|
||||
*
|
||||
* Env var parsing is disabled by default, but you can also explicitly disable it by calling `.env(false)`, e.g. if you need to undo previous configuration.
|
||||
*/
|
||||
env(): Argv<T>;
|
||||
env(prefix: string): Argv<T>;
|
||||
env(enable: boolean): Argv<T>;
|
||||
|
||||
/** A message to print at the end of the usage instructions */
|
||||
epilog(msg: string): Argv<T>;
|
||||
/** A message to print at the end of the usage instructions */
|
||||
epilogue(msg: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Give some example invocations of your program.
|
||||
* Inside `cmd`, the string `$0` will get interpolated to the current script name or node command for the present script similar to how `$0` works in bash or perl.
|
||||
* Examples will be printed out as part of the help message.
|
||||
*/
|
||||
example(command: string, description: string): Argv<T>;
|
||||
example(command: ReadonlyArray<[string, string?]>): Argv<T>;
|
||||
|
||||
/** Manually indicate that the program should exit, and provide context about why we wanted to exit. Follows the behavior set by `.exitProcess().` */
|
||||
exit(code: number, err: Error): void;
|
||||
|
||||
/**
|
||||
* By default, yargs exits the process when the user passes a help flag, the user uses the `.version` functionality, validation fails, or the command handler fails.
|
||||
* Calling `.exitProcess(false)` disables this behavior, enabling further actions after yargs have been validated.
|
||||
*/
|
||||
exitProcess(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Method to execute when a failure occurs, rather than printing the failure message.
|
||||
* @param func Is called with the failure message that would have been printed, the Error instance originally thrown and yargs state when the failure occurred.
|
||||
*/
|
||||
fail(func: (msg: string, err: Error, yargs: Argv<T>) => any): Argv<T>;
|
||||
|
||||
/**
|
||||
* Allows to programmatically get completion choices for any line.
|
||||
* @param args An array of the words in the command line to complete.
|
||||
* @param done The callback to be called with the resulting completions.
|
||||
*/
|
||||
getCompletion(args: ReadonlyArray<string>, done: (completions: ReadonlyArray<string>) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* Indicate that an option (or group of options) should not be reset when a command is executed
|
||||
*
|
||||
* Options default to being global.
|
||||
*/
|
||||
global(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/** Given a key, or an array of keys, places options under an alternative heading when displaying usage instructions */
|
||||
group(key: string | ReadonlyArray<string>, groupName: string): Argv<T>;
|
||||
|
||||
/** Hides a key from the generated usage information. Unless a `--show-hidden` option is also passed with `--help` (see `showHidden()`). */
|
||||
hide(key: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Configure an (e.g. `--help`) and implicit command that displays the usage string and exits the process.
|
||||
* By default yargs enables help on the `--help` option.
|
||||
*
|
||||
* Note that any multi-char aliases (e.g. `help`) used for the help option will also be used for the implicit command.
|
||||
* If there are no multi-char aliases (e.g. `h`), then all single-char aliases will be used for the command.
|
||||
*
|
||||
* If invoked without parameters, `.help()` will use `--help` as the option and help as the implicit command to trigger help output.
|
||||
*
|
||||
* @param [description] Customizes the description of the help option in the usage string.
|
||||
* @param [enableExplicit] If `false` is provided, it will disable --help.
|
||||
*/
|
||||
help(): Argv<T>;
|
||||
help(enableExplicit: boolean): Argv<T>;
|
||||
help(option: string, enableExplicit: boolean): Argv<T>;
|
||||
help(option: string, description?: string, enableExplicit?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Given the key `x` is set, it is required that the key `y` is set.
|
||||
* y` can either be the name of an argument to imply, a number indicating the position of an argument or an array of multiple implications to associate with `x`.
|
||||
*
|
||||
* Optionally `.implies()` can accept an object specifying multiple implications.
|
||||
*/
|
||||
implies(key: string, value: string | ReadonlyArray<string>): Argv<T>;
|
||||
implies(implies: { [key: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Return the locale that yargs is currently using.
|
||||
*
|
||||
* By default, yargs will auto-detect the operating system's locale so that yargs-generated help content will display in the user's language.
|
||||
*/
|
||||
locale(): string;
|
||||
/**
|
||||
* Override the auto-detected locale from the user's operating system with a static locale.
|
||||
* Note that the OS locale can be modified by setting/exporting the `LC_ALL` environment variable.
|
||||
*/
|
||||
locale(loc: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Define global middleware functions to be called first, in list order, for all cli command.
|
||||
* @param callbacks Can be a function or a list of functions. Each callback gets passed a reference to argv.
|
||||
* @param [applyBeforeValidation] Set to `true` to apply middleware before validation. This will execute the middleware prior to validation checks, but after parsing.
|
||||
*/
|
||||
middleware(callbacks: MiddlewareFunction<T> | ReadonlyArray<MiddlewareFunction<T>>, applyBeforeValidation?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* The number of arguments that should be consumed after a key. This can be a useful hint to prevent parsing ambiguity.
|
||||
*
|
||||
* Optionally `.nargs()` can take an object of `key`/`narg` pairs.
|
||||
*/
|
||||
nargs(key: string, count: number): Argv<T>;
|
||||
nargs(nargs: { [key: string]: number }): Argv<T>;
|
||||
|
||||
/** The key provided represents a path and should have `path.normalize()` applied. */
|
||||
normalize<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>;
|
||||
normalize<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>;
|
||||
|
||||
/**
|
||||
* Tell the parser to always interpret key as a number.
|
||||
*
|
||||
* If `key` is an array, all elements will be parsed as numbers.
|
||||
*
|
||||
* If the option is given on the command line without a value, `argv` will be populated with `undefined`.
|
||||
*
|
||||
* If the value given on the command line cannot be parsed as a number, `argv` will be populated with `NaN`.
|
||||
*
|
||||
* Note that decimals, hexadecimals, and scientific notation are all accepted.
|
||||
*/
|
||||
number<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToNumber<T[key]> }>;
|
||||
number<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number | undefined }>;
|
||||
|
||||
/**
|
||||
* Method to execute when a command finishes successfully.
|
||||
* @param func Is called with the successful result of the command that finished.
|
||||
*/
|
||||
onFinishCommand(func: (result: any) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* This method can be used to make yargs aware of options that could exist.
|
||||
* You can also pass an opt object which can hold further customization, like `.alias()`, `.demandOption()` etc. for that option.
|
||||
*/
|
||||
option<K extends keyof T, O extends Options>(key: K, options: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
option<K extends string, O extends Options>(key: K, options: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
option<O extends { [key: string]: Options }>(options: O): Argv<Omit<T, keyof O> & InferredOptionTypes<O>>;
|
||||
|
||||
/**
|
||||
* This method can be used to make yargs aware of options that could exist.
|
||||
* You can also pass an opt object which can hold further customization, like `.alias()`, `.demandOption()` etc. for that option.
|
||||
*/
|
||||
options<K extends keyof T, O extends Options>(key: K, options: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
options<K extends string, O extends Options>(key: K, options: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
options<O extends { [key: string]: Options }>(options: O): Argv<Omit<T, keyof O> & InferredOptionTypes<O>>;
|
||||
|
||||
/**
|
||||
* Parse `args` instead of `process.argv`. Returns the `argv` object. `args` may either be a pre-processed argv array, or a raw argument string.
|
||||
*
|
||||
* Note: Providing a callback to parse() disables the `exitProcess` setting until after the callback is invoked.
|
||||
* @param [context] Provides a useful mechanism for passing state information to commands
|
||||
*/
|
||||
parse(): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
parse(arg: string | ReadonlyArray<string>, context?: object, parseCallback?: ParseCallback<T>): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
|
||||
/**
|
||||
* If the arguments have not been parsed, this property is `false`.
|
||||
*
|
||||
* If the arguments have been parsed, this contain detailed parsed arguments.
|
||||
*/
|
||||
parsed: DetailedArguments | false;
|
||||
|
||||
/** Allows to configure advanced yargs features. */
|
||||
parserConfiguration(configuration: Partial<ParserConfigurationOptions>): Argv<T>;
|
||||
|
||||
/**
|
||||
* Similar to `config()`, indicates that yargs should interpret the object from the specified key in package.json as a configuration object.
|
||||
* @param [cwd] If provided, the package.json will be read from this location
|
||||
*/
|
||||
pkgConf(key: string | ReadonlyArray<string>, cwd?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Allows you to configure a command's positional arguments with an API similar to `.option()`.
|
||||
* `.positional()` should be called in a command's builder function, and is not available on the top-level yargs instance. If so, it will throw an error.
|
||||
*/
|
||||
positional<K extends keyof T, O extends PositionalOptions>(key: K, opt: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
positional<K extends string, O extends PositionalOptions>(key: K, opt: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
|
||||
/** Should yargs provide suggestions regarding similar commands if no matching command is found? */
|
||||
recommendCommands(): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
require<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
require(key: string, msg: string): Argv<T>;
|
||||
require(key: string, required: boolean): Argv<T>;
|
||||
require(keys: ReadonlyArray<number>, msg: string): Argv<T>;
|
||||
require(keys: ReadonlyArray<number>, required: boolean): Argv<T>;
|
||||
require(positionals: number, required: boolean): Argv<T>;
|
||||
require(positionals: number, msg: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
required<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
required(key: string, msg: string): Argv<T>;
|
||||
required(key: string, required: boolean): Argv<T>;
|
||||
required(keys: ReadonlyArray<number>, msg: string): Argv<T>;
|
||||
required(keys: ReadonlyArray<number>, required: boolean): Argv<T>;
|
||||
required(positionals: number, required: boolean): Argv<T>;
|
||||
required(positionals: number, msg: string): Argv<T>;
|
||||
|
||||
requiresArg(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.global()' instead
|
||||
*/
|
||||
reset(): Argv<T>;
|
||||
|
||||
/** Set the name of your script ($0). Default is the base filename executed by node (`process.argv[1]`) */
|
||||
scriptName($0: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Generate a bash completion script.
|
||||
* Users of your application can install this script in their `.bashrc`, and yargs will provide completion shortcuts for commands and options.
|
||||
*/
|
||||
showCompletionScript(): Argv<T>;
|
||||
|
||||
/**
|
||||
* Configure the `--show-hidden` option that displays the hidden keys (see `hide()`).
|
||||
* @param option If `boolean`, it enables/disables this option altogether. i.e. hidden keys will be permanently hidden if first argument is `false`.
|
||||
* If `string` it changes the key name ("--show-hidden").
|
||||
* @param description Changes the default description ("Show hidden options")
|
||||
*/
|
||||
showHidden(option?: string | boolean): Argv<T>;
|
||||
showHidden(option: string, description?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Print the usage data using the console function consoleLevel for printing.
|
||||
* @param [consoleLevel='error']
|
||||
*/
|
||||
showHelp(consoleLevel?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Provide the usage data as a string.
|
||||
* @param printCallback a function with a single argument.
|
||||
*/
|
||||
showHelp(printCallback: (s: string) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* By default, yargs outputs a usage string if any error is detected.
|
||||
* Use the `.showHelpOnFail()` method to customize this behavior.
|
||||
* @param enable If `false`, the usage string is not output.
|
||||
* @param [message] Message that is output after the error message.
|
||||
*/
|
||||
showHelpOnFail(enable: boolean, message?: string): Argv<T>;
|
||||
|
||||
/** Specifies either a single option key (string), or an array of options. If any of the options is present, yargs validation is skipped. */
|
||||
skipValidation(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/**
|
||||
* Any command-line argument given that is not demanded, or does not have a corresponding description, will be reported as an error.
|
||||
*
|
||||
* Unrecognized commands will also be reported as errors.
|
||||
*/
|
||||
strict(): Argv<T>;
|
||||
strict(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Similar to .strict(), except that it only applies to unrecognized commands.
|
||||
* A user can still provide arbitrary options, but unknown positional commands
|
||||
* will raise an error.
|
||||
*/
|
||||
strictCommands(): Argv<T>;
|
||||
strictCommands(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tell the parser logic not to interpret `key` as a number or boolean. This can be useful if you need to preserve leading zeros in an input.
|
||||
*
|
||||
* If `key` is an array, interpret all the elements as strings.
|
||||
*
|
||||
* `.string('_')` will result in non-hyphenated arguments being interpreted as strings, regardless of whether they resemble numbers.
|
||||
*/
|
||||
string<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>;
|
||||
string<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>;
|
||||
|
||||
// Intended to be used with '.wrap()'
|
||||
terminalWidth(): number;
|
||||
|
||||
updateLocale(obj: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Override the default strings used by yargs with the key/value pairs provided in obj
|
||||
*
|
||||
* If you explicitly specify a locale(), you should do so before calling `updateStrings()`.
|
||||
*/
|
||||
updateStrings(obj: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Set a usage message to show which commands to use.
|
||||
* Inside `message`, the string `$0` will get interpolated to the current script name or node command for the present script similar to how `$0` works in bash or perl.
|
||||
*
|
||||
* If the optional `description`/`builder`/`handler` are provided, `.usage()` acts an an alias for `.command()`.
|
||||
* This allows you to use `.usage()` to configure the default command that will be run as an entry-point to your application
|
||||
* and allows you to provide configuration for the positional arguments accepted by your program:
|
||||
*/
|
||||
usage(message: string): Argv<T>;
|
||||
usage<U>(command: string | ReadonlyArray<string>, description: string, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
usage<U>(command: string | ReadonlyArray<string>, showInHelp: boolean, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
usage<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, description: string, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
usage<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, showInHelp: boolean, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* Add an option (e.g. `--version`) that displays the version number (given by the version parameter) and exits the process.
|
||||
* By default yargs enables version for the `--version` option.
|
||||
*
|
||||
* If no arguments are passed to version (`.version()`), yargs will parse the package.json of your module and use its version value.
|
||||
*
|
||||
* If the boolean argument `false` is provided, it will disable `--version`.
|
||||
*/
|
||||
version(): Argv<T>;
|
||||
version(version: string): Argv<T>;
|
||||
version(enable: boolean): Argv<T>;
|
||||
version(optionKey: string, version: string): Argv<T>;
|
||||
version(optionKey: string, description: string, version: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Format usage output to wrap at columns many columns.
|
||||
*
|
||||
* By default wrap will be set to `Math.min(80, windowWidth)`. Use `.wrap(null)` to specify no column limit (no right-align).
|
||||
* Use `.wrap(yargs.terminalWidth())` to maximize the width of yargs' usage instructions.
|
||||
*/
|
||||
wrap(columns: number | null): Argv<T>;
|
||||
}
|
||||
|
||||
type Arguments<T = {}> = T & {
|
||||
/** Non-option arguments */
|
||||
_: Array<string | number>;
|
||||
/** The script name or node command */
|
||||
$0: string;
|
||||
/** All remaining options */
|
||||
[argName: string]: unknown;
|
||||
};
|
||||
|
||||
interface RequireDirectoryOptions {
|
||||
/** Look for command modules in all subdirectories and apply them as a flattened (non-hierarchical) list. */
|
||||
recurse?: boolean | undefined;
|
||||
/** The types of files to look for when requiring command modules. */
|
||||
extensions?: ReadonlyArray<string> | undefined;
|
||||
/**
|
||||
* A synchronous function called for each command module encountered.
|
||||
* Accepts `commandObject`, `pathToFile`, and `filename` as arguments.
|
||||
* Returns `commandObject` to include the command; any falsy value to exclude/skip it.
|
||||
*/
|
||||
visit?: ((commandObject: any, pathToFile?: string, filename?: string) => any) | undefined;
|
||||
/** Whitelist certain modules */
|
||||
include?: RegExp | ((pathToFile: string) => boolean) | undefined;
|
||||
/** Blacklist certain modules. */
|
||||
exclude?: RegExp | ((pathToFile: string) => boolean) | undefined;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/** string or array of strings, alias(es) for the canonical option key, see `alias()` */
|
||||
alias?: string | ReadonlyArray<string> | undefined;
|
||||
/** boolean, interpret option as an array, see `array()` */
|
||||
array?: boolean | undefined;
|
||||
/** boolean, interpret option as a boolean flag, see `boolean()` */
|
||||
boolean?: boolean | undefined;
|
||||
/** value or array of values, limit valid option arguments to a predefined set, see `choices()` */
|
||||
choices?: Choices | undefined;
|
||||
/** function, coerce or transform parsed command line values into another value, see `coerce()` */
|
||||
coerce?: ((arg: any) => any) | undefined;
|
||||
/** boolean, interpret option as a path to a JSON config file, see `config()` */
|
||||
config?: boolean | undefined;
|
||||
/** function, provide a custom config parsing function, see `config()` */
|
||||
configParser?: ((configPath: string) => object) | undefined;
|
||||
/** string or object, require certain keys not to be set, see `conflicts()` */
|
||||
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> } | undefined;
|
||||
/** boolean, interpret option as a count of boolean flags, see `count()` */
|
||||
count?: boolean | undefined;
|
||||
/** value, set a default value for the option, see `default()` */
|
||||
default?: any;
|
||||
/** string, use this description for the default value in help content, see `default()` */
|
||||
defaultDescription?: string | undefined;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
demand?: boolean | string | undefined;
|
||||
/** boolean or string, mark the argument as deprecated, see `deprecateOption()` */
|
||||
deprecate?: boolean | string | undefined;
|
||||
/** boolean or string, mark the argument as deprecated, see `deprecateOption()` */
|
||||
deprecated?: boolean | string | undefined;
|
||||
/** boolean or string, demand the option be given, with optional error message, see `demandOption()` */
|
||||
demandOption?: boolean | string | undefined;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
desc?: string | undefined;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
describe?: string | undefined;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
description?: string | undefined;
|
||||
/** boolean, indicate that this key should not be reset when a command is invoked, see `global()` */
|
||||
global?: boolean | undefined;
|
||||
/** string, when displaying usage instructions place the option under an alternative group heading, see `group()` */
|
||||
group?: string | undefined;
|
||||
/** don't display option in help output. */
|
||||
hidden?: boolean | undefined;
|
||||
/** string or object, require certain keys to be set, see `implies()` */
|
||||
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> } | undefined;
|
||||
/** number, specify how many arguments should be consumed for the option, see `nargs()` */
|
||||
nargs?: number | undefined;
|
||||
/** boolean, apply path.normalize() to the option, see `normalize()` */
|
||||
normalize?: boolean | undefined;
|
||||
/** boolean, interpret option as a number, `number()` */
|
||||
number?: boolean | undefined;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
require?: boolean | string | undefined;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
required?: boolean | string | undefined;
|
||||
/** boolean, require the option be specified with a value, see `requiresArg()` */
|
||||
requiresArg?: boolean | undefined;
|
||||
/** boolean, skips validation if the option is present, see `skipValidation()` */
|
||||
skipValidation?: boolean | undefined;
|
||||
/** boolean, interpret option as a string, see `string()` */
|
||||
string?: boolean | undefined;
|
||||
type?: "array" | "count" | PositionalOptionsType | undefined;
|
||||
}
|
||||
|
||||
interface PositionalOptions {
|
||||
/** string or array of strings, see `alias()` */
|
||||
alias?: string | ReadonlyArray<string> | undefined;
|
||||
/** boolean, interpret option as an array, see `array()` */
|
||||
array?: boolean | undefined;
|
||||
/** value or array of values, limit valid option arguments to a predefined set, see `choices()` */
|
||||
choices?: Choices | undefined;
|
||||
/** function, coerce or transform parsed command line values into another value, see `coerce()` */
|
||||
coerce?: ((arg: any) => any) | undefined;
|
||||
/** string or object, require certain keys not to be set, see `conflicts()` */
|
||||
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> } | undefined;
|
||||
/** value, set a default value for the option, see `default()` */
|
||||
default?: any;
|
||||
/** boolean or string, demand the option be given, with optional error message, see `demandOption()` */
|
||||
demandOption?: boolean | string | undefined;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
desc?: string | undefined;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
describe?: string | undefined;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
description?: string | undefined;
|
||||
/** string or object, require certain keys to be set, see `implies()` */
|
||||
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> } | undefined;
|
||||
/** boolean, apply path.normalize() to the option, see normalize() */
|
||||
normalize?: boolean | undefined;
|
||||
type?: PositionalOptionsType | undefined;
|
||||
}
|
||||
|
||||
/** Remove keys K in T */
|
||||
type Omit<T, K> = { [key in Exclude<keyof T, K>]: T[key] };
|
||||
|
||||
/** Remove undefined as a possible value for keys K in T */
|
||||
type Defined<T, K extends keyof T> = Omit<T, K> & { [key in K]: Exclude<T[key], undefined> };
|
||||
|
||||
/** Convert T to T[] and T | undefined to T[] | undefined */
|
||||
type ToArray<T> = Array<Exclude<T, undefined>> | Extract<T, undefined>;
|
||||
|
||||
/** Gives string[] if T is an array type, otherwise string. Preserves | undefined. */
|
||||
type ToString<T> = (Exclude<T, undefined> extends any[] ? string[] : string) | Extract<T, undefined>;
|
||||
|
||||
/** Gives number[] if T is an array type, otherwise number. Preserves | undefined. */
|
||||
type ToNumber<T> = (Exclude<T, undefined> extends any[] ? number[] : number) | Extract<T, undefined>;
|
||||
|
||||
type InferredOptionType<O extends Options | PositionalOptions> =
|
||||
O extends { default: any, coerce: (arg: any) => infer T } ? T :
|
||||
O extends { default: infer D } ? D :
|
||||
O extends { type: "count" } ? number :
|
||||
O extends { count: true } ? number :
|
||||
O extends { required: string | true } ? RequiredOptionType<O> :
|
||||
O extends { require: string | true } ? RequiredOptionType<O> :
|
||||
O extends { demand: string | true } ? RequiredOptionType<O> :
|
||||
O extends { demandOption: string | true } ? RequiredOptionType<O> :
|
||||
RequiredOptionType<O> | undefined;
|
||||
|
||||
type RequiredOptionType<O extends Options | PositionalOptions> =
|
||||
O extends { type: "array", string: true } ? string[] :
|
||||
O extends { type: "array", number: true } ? number[] :
|
||||
O extends { type: "array", normalize: true } ? string[] :
|
||||
O extends { type: "string", array: true } ? string[] :
|
||||
O extends { type: "number", array: true } ? number[] :
|
||||
O extends { string: true, array: true } ? string[] :
|
||||
O extends { number: true, array: true } ? number[] :
|
||||
O extends { normalize: true, array: true } ? string[] :
|
||||
O extends { type: "array" } ? Array<string | number> :
|
||||
O extends { type: "boolean" } ? boolean :
|
||||
O extends { type: "number" } ? number :
|
||||
O extends { type: "string" } ? string :
|
||||
O extends { array: true } ? Array<string | number> :
|
||||
O extends { boolean: true } ? boolean :
|
||||
O extends { number: true } ? number :
|
||||
O extends { string: true } ? string :
|
||||
O extends { normalize: true } ? string :
|
||||
O extends { choices: ReadonlyArray<infer C> } ? C :
|
||||
O extends { coerce: (arg: any) => infer T } ? T :
|
||||
unknown;
|
||||
|
||||
type InferredOptionTypes<O extends { [key: string]: Options }> = { [key in keyof O]: InferredOptionType<O[key]> };
|
||||
|
||||
interface CommandModule<T = {}, U = {}> {
|
||||
/** array of strings (or a single string) representing aliases of `exports.command`, positional args defined in an alias are ignored */
|
||||
aliases?: ReadonlyArray<string> | string | undefined;
|
||||
/** object declaring the options the command accepts, or a function accepting and returning a yargs instance */
|
||||
builder?: CommandBuilder<T, U> | undefined;
|
||||
/** string (or array of strings) that executes this command when given on the command line, first string may contain positional args */
|
||||
command?: ReadonlyArray<string> | string | undefined;
|
||||
/** boolean (or string) to show deprecation notice */
|
||||
deprecated?: boolean | string | undefined;
|
||||
/** string used as the description for the command in help text, use `false` for a hidden command */
|
||||
describe?: string | false | undefined;
|
||||
/** a function which will be passed the parsed argv. */
|
||||
handler: (args: Arguments<U>) => void;
|
||||
}
|
||||
|
||||
type ParseCallback<T = {}> = (err: Error | undefined, argv: Arguments<T>, output: string) => void;
|
||||
type CommandBuilder<T = {}, U = {}> = { [key: string]: Options } | ((args: Argv<T>) => Argv<U>) | ((args: Argv<T>) => PromiseLike<Argv<U>>);
|
||||
type SyncCompletionFunction = (current: string, argv: any) => string[];
|
||||
type AsyncCompletionFunction = (current: string, argv: any, done: (completion: ReadonlyArray<string>) => void) => void;
|
||||
type PromiseCompletionFunction = (current: string, argv: any) => Promise<string[]>;
|
||||
type MiddlewareFunction<T = {}> = (args: Arguments<T>) => void;
|
||||
type Choices = ReadonlyArray<string | number | true | undefined>;
|
||||
type PositionalOptionsType = "boolean" | "number" | "string";
|
||||
}
|
||||
|
||||
declare var yargs: yargs.Argv;
|
||||
export = yargs;
|
62
web/node_modules/jest-cli/node_modules/@types/yargs/package.json
generated
vendored
Executable file
62
web/node_modules/jest-cli/node_modules/@types/yargs/package.json
generated
vendored
Executable file
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"name": "@types/yargs",
|
||||
"version": "15.0.14",
|
||||
"description": "TypeScript definitions for yargs",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Martin Poelstra",
|
||||
"url": "https://github.com/poelstra",
|
||||
"githubUsername": "poelstra"
|
||||
},
|
||||
{
|
||||
"name": "Mizunashi Mana",
|
||||
"url": "https://github.com/mizunashi-mana",
|
||||
"githubUsername": "mizunashi-mana"
|
||||
},
|
||||
{
|
||||
"name": "Jeffery Grajkowski",
|
||||
"url": "https://github.com/pushplay",
|
||||
"githubUsername": "pushplay"
|
||||
},
|
||||
{
|
||||
"name": "Jimi (Dimitris) Charalampidis",
|
||||
"url": "https://github.com/JimiC",
|
||||
"githubUsername": "JimiC"
|
||||
},
|
||||
{
|
||||
"name": "Steffen Viken Valvåg",
|
||||
"url": "https://github.com/steffenvv",
|
||||
"githubUsername": "steffenvv"
|
||||
},
|
||||
{
|
||||
"name": "Emily Marigold Klassen",
|
||||
"url": "https://github.com/forivall",
|
||||
"githubUsername": "forivall"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"url": "https://github.com/ExE-Boss",
|
||||
"githubUsername": "ExE-Boss"
|
||||
},
|
||||
{
|
||||
"name": "Aankhen",
|
||||
"url": "https://github.com/Aankhen",
|
||||
"githubUsername": "Aankhen"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/yargs"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/yargs-parser": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "08f18db584d12815700691202627482987b3f369093c020e1539deee222b2a09",
|
||||
"typeScriptVersion": "3.6"
|
||||
}
|
9
web/node_modules/jest-cli/node_modules/@types/yargs/yargs.d.ts
generated
vendored
Executable file
9
web/node_modules/jest-cli/node_modules/@types/yargs/yargs.d.ts
generated
vendored
Executable file
|
@ -0,0 +1,9 @@
|
|||
import { Argv } from '.';
|
||||
|
||||
export = Yargs;
|
||||
|
||||
declare function Yargs(
|
||||
processArgs?: ReadonlyArray<string>,
|
||||
cwd?: string,
|
||||
parentRequire?: NodeRequire,
|
||||
): Argv;
|
76
web/node_modules/jest-cli/package.json
generated
vendored
Normal file
76
web/node_modules/jest-cli/package.json
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"name": "jest-cli",
|
||||
"description": "Delightful JavaScript Testing.",
|
||||
"version": "26.6.3",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@jest/core": "^26.6.3",
|
||||
"@jest/test-result": "^26.6.2",
|
||||
"@jest/types": "^26.6.2",
|
||||
"chalk": "^4.0.0",
|
||||
"exit": "^0.1.2",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"import-local": "^3.0.2",
|
||||
"is-ci": "^2.0.0",
|
||||
"jest-config": "^26.6.3",
|
||||
"jest-util": "^26.6.2",
|
||||
"jest-validate": "^26.6.2",
|
||||
"prompts": "^2.0.1",
|
||||
"yargs": "^15.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/test-utils": "^26.6.2",
|
||||
"@types/exit": "^0.1.30",
|
||||
"@types/graceful-fs": "^4.1.3",
|
||||
"@types/is-ci": "^2.0.0",
|
||||
"@types/prompts": "^2.0.1",
|
||||
"@types/yargs": "^15.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"jest": "./bin/jest.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.14.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest",
|
||||
"directory": "packages/jest-cli"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/jest/issues"
|
||||
},
|
||||
"homepage": "https://jestjs.io/",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"ava",
|
||||
"babel",
|
||||
"coverage",
|
||||
"easy",
|
||||
"expect",
|
||||
"facebook",
|
||||
"immersive",
|
||||
"instant",
|
||||
"jasmine",
|
||||
"jest",
|
||||
"jsdom",
|
||||
"mocha",
|
||||
"mocking",
|
||||
"painless",
|
||||
"qunit",
|
||||
"runner",
|
||||
"sandboxed",
|
||||
"snapshot",
|
||||
"tap",
|
||||
"tape",
|
||||
"test",
|
||||
"testing",
|
||||
"typescript",
|
||||
"watch"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "2f6931e91d5ab126de70caf150c68709752e7f6c"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue