This commit is contained in:
Stephen Franceschelli 2019-07-30 13:41:05 -04:00
parent 596a6da241
commit c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions

23
node_modules/jest-config/LICENSE generated vendored Normal file
View file

@ -0,0 +1,23 @@
MIT License
For Jest software
Copyright (c) 2014-present, Facebook, Inc.
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.

10
node_modules/jest-config/build/Defaults.d.ts generated vendored Normal file
View 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 { Config } from '@jest/types';
declare const defaultOptions: Config.DefaultOptions;
export default defaultOptions;
//# sourceMappingURL=Defaults.d.ts.map

1
node_modules/jest-config/build/Defaults.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"Defaults.d.ts","sourceRoot":"","sources":["../src/Defaults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAOnC,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,cAqE5B,CAAC;AAEF,eAAe,cAAc,CAAC"}

106
node_modules/jest-config/build/Defaults.js generated vendored Normal file
View file

@ -0,0 +1,106 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestRegexUtil() {
const data = require('jest-regex-util');
_jestRegexUtil = function _jestRegexUtil() {
return data;
};
return data;
}
var _constants = require('./constants');
var _getCacheDirectory = _interopRequireDefault(require('./getCacheDirectory'));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const NODE_MODULES_REGEXP = (0, _jestRegexUtil().replacePathSepForRegex)(
_constants.NODE_MODULES
);
const defaultOptions = {
automock: false,
bail: 0,
browser: false,
cache: true,
cacheDirectory: (0, _getCacheDirectory.default)(),
changedFilesWithAncestor: false,
clearMocks: false,
collectCoverage: false,
collectCoverageFrom: null,
coverageDirectory: null,
coveragePathIgnorePatterns: [NODE_MODULES_REGEXP],
coverageReporters: ['json', 'text', 'lcov', 'clover'],
coverageThreshold: null,
dependencyExtractor: null,
errorOnDeprecated: false,
expand: false,
filter: null,
forceCoverageMatch: [],
globalSetup: null,
globalTeardown: null,
globals: {},
haste: {
computeSha1: false,
providesModuleNodeModules: [],
throwOnModuleCollision: false
},
maxConcurrency: 5,
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
moduleNameMapper: {},
modulePathIgnorePatterns: [],
noStackTrace: false,
notify: false,
notifyMode: 'failure-change',
preset: null,
prettierPath: 'prettier',
projects: null,
resetMocks: false,
resetModules: false,
resolver: null,
restoreMocks: false,
rootDir: null,
roots: ['<rootDir>'],
runTestsByPath: false,
runner: 'jest-runner',
setupFiles: [],
setupFilesAfterEnv: [],
skipFilter: false,
snapshotSerializers: [],
testEnvironment: 'jest-environment-jsdom',
testEnvironmentOptions: {},
testFailureExitCode: 1,
testLocationInResults: false,
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'],
testPathIgnorePatterns: [NODE_MODULES_REGEXP],
testRegex: [],
testResultsProcessor: null,
testRunner: 'jasmine2',
testSequencer: '@jest/test-sequencer',
testURL: 'http://localhost',
timers: 'real',
transform: null,
transformIgnorePatterns: [NODE_MODULES_REGEXP],
useStderr: false,
verbose: null,
watch: false,
watchPathIgnorePatterns: [],
watchman: true
};
var _default = defaultOptions;
exports.default = _default;

9
node_modules/jest-config/build/Deprecated.d.ts generated vendored Normal file
View 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.
*/
declare const _default: Record<string, Function>;
export default _default;
//# sourceMappingURL=Deprecated.d.ts.map

1
node_modules/jest-config/build/Deprecated.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"Deprecated.d.ts","sourceRoot":"","sources":["../src/Deprecated.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAOH,wBAgE8B"}

146
node_modules/jest-config/build/Deprecated.js generated vendored Normal file
View file

@ -0,0 +1,146 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
function _prettyFormat() {
const data = _interopRequireDefault(require('pretty-format'));
_prettyFormat = function _prettyFormat() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const format = value =>
(0, _prettyFormat().default)(value, {
min: true
});
var _default = {
mapCoverage: () => ` Option ${_chalk().default.bold(
'"mapCoverage"'
)} has been removed, as it's no longer necessary.
Please update your configuration.`,
preprocessorIgnorePatterns: (function(_preprocessorIgnorePatterns) {
function preprocessorIgnorePatterns(_x) {
return _preprocessorIgnorePatterns.apply(this, arguments);
}
preprocessorIgnorePatterns.toString = function() {
return _preprocessorIgnorePatterns.toString();
};
return preprocessorIgnorePatterns;
})(
options => ` Option ${_chalk().default.bold(
'"preprocessorIgnorePatterns"'
)} was replaced by ${_chalk().default.bold(
'"transformIgnorePatterns"'
)}, which support multiple preprocessors.
Jest now treats your current configuration as:
{
${_chalk().default.bold(
'"transformIgnorePatterns"'
)}: ${_chalk().default.bold(format(options.preprocessorIgnorePatterns))}
}
Please update your configuration.`
),
scriptPreprocessor: (function(_scriptPreprocessor) {
function scriptPreprocessor(_x2) {
return _scriptPreprocessor.apply(this, arguments);
}
scriptPreprocessor.toString = function() {
return _scriptPreprocessor.toString();
};
return scriptPreprocessor;
})(
options => ` Option ${_chalk().default.bold(
'"scriptPreprocessor"'
)} was replaced by ${_chalk().default.bold(
'"transform"'
)}, which support multiple preprocessors.
Jest now treats your current configuration as:
{
${_chalk().default.bold('"transform"')}: ${_chalk().default.bold(
`{".*": ${format(options.scriptPreprocessor)}}`
)}
}
Please update your configuration.`
),
setupTestFrameworkScriptFile: (function(_setupTestFrameworkScriptFile) {
function setupTestFrameworkScriptFile(_x3) {
return _setupTestFrameworkScriptFile.apply(this, arguments);
}
setupTestFrameworkScriptFile.toString = function() {
return _setupTestFrameworkScriptFile.toString();
};
return setupTestFrameworkScriptFile;
})(
_options => ` Option ${_chalk().default.bold(
'"setupTestFrameworkScriptFile"'
)} was replaced by configuration ${_chalk().default.bold(
'"setupFilesAfterEnv"'
)}, which supports multiple paths.
Please update your configuration.`
),
testPathDirs: (function(_testPathDirs) {
function testPathDirs(_x4) {
return _testPathDirs.apply(this, arguments);
}
testPathDirs.toString = function() {
return _testPathDirs.toString();
};
return testPathDirs;
})(
options => ` Option ${_chalk().default.bold(
'"testPathDirs"'
)} was replaced by ${_chalk().default.bold('"roots"')}.
Jest now treats your current configuration as:
{
${_chalk().default.bold('"roots"')}: ${_chalk().default.bold(
format(options.testPathDirs)
)}
}
Please update your configuration.
`
)
};
exports.default = _default;

12
node_modules/jest-config/build/Descriptions.d.ts generated vendored Normal file
View 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 { Config } from '@jest/types';
declare const descriptions: {
[key in keyof Config.InitialOptions]: string;
};
export default descriptions;
//# sourceMappingURL=Descriptions.d.ts.map

1
node_modules/jest-config/build/Descriptions.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"Descriptions.d.ts","sourceRoot":"","sources":["../src/Descriptions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,QAAA,MAAM,YAAY,EAAE;KAAE,GAAG,IAAI,MAAM,MAAM,CAAC,cAAc,GAAG,MAAM;CAoFhE,CAAC;AAEF,eAAe,YAAY,CAAC"}

100
node_modules/jest-config/build/Descriptions.js generated vendored Normal file
View file

@ -0,0 +1,100 @@
'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 descriptions = {
automock: 'All imported modules in your tests should be mocked automatically',
bail: 'Stop running tests after `n` failures',
browser: 'Respect "browser" field in package.json when resolving modules',
cacheDirectory:
'The directory where Jest should store its cached dependency information',
clearMocks: 'Automatically clear mock calls and instances between every test',
collectCoverage:
'Indicates whether the coverage information should be collected while executing the test',
collectCoverageFrom:
'An array of glob patterns indicating a set of files for which coverage information should be collected',
coverageDirectory:
'The directory where Jest should output its coverage files',
coveragePathIgnorePatterns:
'An array of regexp pattern strings used to skip coverage collection',
coverageReporters:
'A list of reporter names that Jest uses when writing coverage reports',
coverageThreshold:
'An object that configures minimum threshold enforcement for coverage results',
dependencyExtractor: 'A path to a custom dependency extractor',
errorOnDeprecated:
'Make calling deprecated APIs throw helpful error messages',
forceCoverageMatch:
'Force coverage collection from ignored files using an array of glob patterns',
globalSetup:
'A path to a module which exports an async function that is triggered once before all test suites',
globalTeardown:
'A path to a module which exports an async function that is triggered once after all test suites',
globals:
'A set of global variables that need to be available in all test environments',
moduleDirectories:
"An array of directory names to be searched recursively up from the requiring module's location",
moduleFileExtensions: 'An array of file extensions your modules use',
moduleNameMapper:
'A map from regular expressions to module names that allow to stub out resources with a single module',
modulePathIgnorePatterns:
"An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader",
notify: 'Activates notifications for test results',
notifyMode:
'An enum that specifies notification mode. Requires { notify: true }',
preset: "A preset that is used as a base for Jest's configuration",
projects: 'Run tests from one or more projects',
reporters: 'Use this configuration option to add custom reporters to Jest',
resetMocks: 'Automatically reset mock state between every test',
resetModules: 'Reset the module registry before running each individual test',
resolver: 'A path to a custom resolver',
restoreMocks: 'Automatically restore mock state between every test',
rootDir:
'The root directory that Jest should scan for tests and modules within',
roots:
'A list of paths to directories that Jest should use to search for files in',
runner:
"Allows you to use a custom runner instead of Jest's default test runner",
setupFiles:
'The paths to modules that run some code to configure or set up the testing environment before each test',
setupFilesAfterEnv:
'A list of paths to modules that run some code to configure or set up the testing framework before each test',
snapshotSerializers:
'A list of paths to snapshot serializer modules Jest should use for snapshot testing',
testEnvironment: 'The test environment that will be used for testing',
testEnvironmentOptions: 'Options that will be passed to the testEnvironment',
testLocationInResults: 'Adds a location field to test results',
testMatch: 'The glob patterns Jest uses to detect test files',
testPathIgnorePatterns:
'An array of regexp pattern strings that are matched against all test paths, matched tests are skipped',
testRegex:
'The regexp pattern or array of patterns that Jest uses to detect test files',
testResultsProcessor:
'This option allows the use of a custom results processor',
testRunner: 'This option allows use of a custom test runner',
testURL:
'This option sets the URL for the jsdom environment. It is reflected in properties such as location.href',
timers:
'Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"',
transform: 'A map from regular expressions to paths to transformers',
transformIgnorePatterns:
'An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation',
unmockedModulePathPatterns:
'An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them',
verbose:
'Indicates whether each individual test should be reported during the run',
watchPathIgnorePatterns:
'An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode',
watchman: 'Whether to use watchman for file crawling'
};
var _default = descriptions;
exports.default = _default;

View file

@ -0,0 +1,19 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Config } from '@jest/types';
/**
* Reporter Validation Error is thrown if the given arguments
* within the reporter are not valid.
*
* This is a highly specific reporter error and in the future will be
* merged with jest-validate. Till then, we can make use of it. It works
* and that's what counts most at this time.
*/
export declare function createReporterError(reporterIndex: number, reporterValue: Array<Config.ReporterConfig> | string): import("../../jest-validate/build/utils").ValidationError;
export declare function createArrayReporterError(arrayReporter: Config.ReporterConfig, reporterIndex: number, valueIndex: number, value: string | Record<string, any>, expectedType: string, valueName: string): import("../../jest-validate/build/utils").ValidationError;
export declare function validateReporters(reporterConfig: Array<Config.ReporterConfig | string>): boolean;
//# sourceMappingURL=ReporterValidationErrors.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"ReporterValidationErrors.d.ts","sourceRoot":"","sources":["../src/ReporterValidationErrors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AASnC;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,6DASrD;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,CAAC,cAAc,EACpC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,6DAiBlB;AAED,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,GACpD,OAAO,CAUT"}

View file

@ -0,0 +1,177 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.createReporterError = createReporterError;
exports.createArrayReporterError = createArrayReporterError;
exports.validateReporters = validateReporters;
function _jestValidate() {
const data = require('jest-validate');
_jestValidate = function _jestValidate() {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
function _jestGetType() {
const data = _interopRequireDefault(require('jest-get-type'));
_jestGetType = function _jestGetType() {
return data;
};
return data;
}
var _utils = require('./utils');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _slicedToArray(arr, i) {
return (
_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
);
}
function _nonIterableRest() {
throw new TypeError('Invalid attempt to destructure non-iterable instance');
}
function _iterableToArrayLimit(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (
var _i = arr[Symbol.iterator](), _s;
!(_n = (_s = _i.next()).done);
_n = true
) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i['return'] != null) _i['return']();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
const validReporterTypes = ['array', 'string'];
const ERROR = `${_utils.BULLET}Reporter Validation Error`;
/**
* Reporter Validation Error is thrown if the given arguments
* within the reporter are not valid.
*
* This is a highly specific reporter error and in the future will be
* merged with jest-validate. Till then, we can make use of it. It works
* and that's what counts most at this time.
*/
function createReporterError(reporterIndex, reporterValue) {
const errorMessage =
` Reporter at index ${reporterIndex} must be of type:\n` +
` ${_chalk().default.bold.green(validReporterTypes.join(' or '))}\n` +
` but instead received:\n` +
` ${_chalk().default.bold.red(
(0, _jestGetType().default)(reporterValue)
)}`;
return new (_jestValidate()).ValidationError(
ERROR,
errorMessage,
_utils.DOCUMENTATION_NOTE
);
}
function createArrayReporterError(
arrayReporter,
reporterIndex,
valueIndex,
value,
expectedType,
valueName
) {
const errorMessage =
` Unexpected value for ${valueName} ` +
`at index ${valueIndex} of reporter at index ${reporterIndex}\n` +
' Expected:\n' +
` ${_chalk().default.bold.red(expectedType)}\n` +
' Got:\n' +
` ${_chalk().default.bold.green((0, _jestGetType().default)(value))}\n` +
` Reporter configuration:\n` +
` ${_chalk().default.bold.green(
JSON.stringify(arrayReporter, null, 2)
.split('\n')
.join('\n ')
)}`;
return new (_jestValidate()).ValidationError(
ERROR,
errorMessage,
_utils.DOCUMENTATION_NOTE
);
}
function validateReporters(reporterConfig) {
return reporterConfig.every((reporter, index) => {
if (Array.isArray(reporter)) {
validateArrayReporter(reporter, index);
} else if (typeof reporter !== 'string') {
throw createReporterError(index, reporter);
}
return true;
});
}
function validateArrayReporter(arrayReporter, reporterIndex) {
const _arrayReporter = _slicedToArray(arrayReporter, 2),
path = _arrayReporter[0],
options = _arrayReporter[1];
if (typeof path !== 'string') {
throw createArrayReporterError(
arrayReporter,
reporterIndex,
0,
path,
'string',
'Path'
);
} else if (typeof options !== 'object') {
throw createArrayReporterError(
arrayReporter,
reporterIndex,
1,
options,
'object',
'Reporter Configuration'
);
}
}

10
node_modules/jest-config/build/ValidConfig.d.ts generated vendored Normal file
View 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 { Config } from '@jest/types';
declare const initialOptions: Config.InitialOptions;
export default initialOptions;
//# sourceMappingURL=ValidConfig.d.ts.map

1
node_modules/jest-config/build/ValidConfig.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"ValidConfig.d.ts","sourceRoot":"","sources":["../src/ValidConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAOnC,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,cA8H5B,CAAC;AAEF,eAAe,cAAc,CAAC"}

176
node_modules/jest-config/build/ValidConfig.js generated vendored Normal file
View file

@ -0,0 +1,176 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestRegexUtil() {
const data = require('jest-regex-util');
_jestRegexUtil = function _jestRegexUtil() {
return data;
};
return data;
}
function _jestValidate() {
const data = require('jest-validate');
_jestValidate = function _jestValidate() {
return data;
};
return data;
}
var _constants = require('./constants');
/**
* 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 NODE_MODULES_REGEXP = (0, _jestRegexUtil().replacePathSepForRegex)(
_constants.NODE_MODULES
);
const initialOptions = {
automock: false,
// @ts-ignore TODO: type this properly
bail: (0, _jestValidate().multipleValidOptions)(false, 0),
browser: false,
cache: true,
cacheDirectory: '/tmp/user/jest',
changedFilesWithAncestor: false,
changedSince: 'master',
clearMocks: false,
collectCoverage: true,
collectCoverageFrom: ['src', '!public'],
collectCoverageOnlyFrom: {
'<rootDir>/this-directory-is-covered/Covered.js': true
},
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [NODE_MODULES_REGEXP],
coverageReporters: ['json', 'text', 'lcov', 'clover'],
coverageThreshold: {
global: {
branches: 50,
functions: 100,
lines: 100,
statements: 100
}
},
dependencyExtractor: '<rootDir>/dependencyExtractor.js',
// @ts-ignore TODO: type this properly
displayName: (0, _jestValidate().multipleValidOptions)('test-config', {
color: 'blue',
name: 'test-config'
}),
errorOnDeprecated: false,
expand: false,
extraGlobals: [],
filter: '<rootDir>/filter.js',
forceCoverageMatch: ['**/*.t.js'],
forceExit: false,
globalSetup: 'setup.js',
globalTeardown: 'teardown.js',
globals: {
__DEV__: true
},
haste: {
computeSha1: true,
defaultPlatform: 'ios',
hasteImplModulePath: '<rootDir>/haste_impl.js',
platforms: ['ios', 'android'],
providesModuleNodeModules: ['react', 'react-native'],
throwOnModuleCollision: false
},
json: false,
lastCommit: false,
logHeapUsage: true,
maxConcurrency: 5,
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
moduleLoader: '<rootDir>',
moduleNameMapper: {
'^React$': '<rootDir>/node_modules/react'
},
modulePathIgnorePatterns: ['<rootDir>/build/'],
modulePaths: ['/shared/vendor/modules'],
name: 'string',
noStackTrace: false,
notify: false,
notifyMode: 'failure-change',
onlyChanged: false,
preset: 'react-native',
prettierPath: '<rootDir>/node_modules/prettier',
projects: ['project-a', 'project-b/'],
reporters: [
'default',
'custom-reporter-1',
[
'custom-reporter-2',
{
configValue: true
}
]
],
resetMocks: false,
resetModules: false,
resolver: '<rootDir>/resolver.js',
restoreMocks: false,
rootDir: '/',
roots: ['<rootDir>'],
runTestsByPath: false,
runner: 'jest-runner',
setupFiles: ['<rootDir>/setup.js'],
setupFilesAfterEnv: ['<rootDir>/testSetupFile.js'],
silent: true,
skipFilter: false,
skipNodeResolution: false,
snapshotResolver: '<rootDir>/snapshotResolver.js',
snapshotSerializers: ['my-serializer-module'],
testEnvironment: 'jest-environment-jsdom',
testEnvironmentOptions: {
userAgent: 'Agent/007'
},
testFailureExitCode: 1,
testLocationInResults: false,
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
testNamePattern: 'test signature',
testPathIgnorePatterns: [NODE_MODULES_REGEXP],
testRegex: (0, _jestValidate().multipleValidOptions)(
'(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
['/__tests__/\\.test\\.[jt]sx?$', '/__tests__/\\.spec\\.[jt]sx?$']
),
testResultsProcessor: 'processor-node-module',
testRunner: 'jasmine2',
testSequencer: '@jest/test-sequencer',
testURL: 'http://localhost',
timers: 'real',
transform: {
'^.+\\.js$': '<rootDir>/preprocessor.js'
},
transformIgnorePatterns: [NODE_MODULES_REGEXP],
unmockedModulePathPatterns: ['mock'],
updateSnapshot: true,
useStderr: false,
verbose: false,
watch: false,
watchPathIgnorePatterns: ['<rootDir>/e2e/'],
watchPlugins: [
'path/to/yourWatchPlugin',
[
'jest-watch-typeahead/filename',
{
key: 'k',
prompt: 'do something with my custom prompt'
}
]
],
watchman: true
};
var _default = initialOptions;
exports.default = _default;

12
node_modules/jest-config/build/constants.d.ts generated vendored Normal file
View 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 const NODE_MODULES: string;
export declare const DEFAULT_JS_PATTERN = "^.+\\.[jt]sx?$";
export declare const DEFAULT_REPORTER_LABEL = "default";
export declare const PACKAGE_JSON = "package.json";
export declare const JEST_CONFIG = "jest.config.js";
//# sourceMappingURL=constants.d.ts.map

1
node_modules/jest-config/build/constants.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,YAAY,QAAuC,CAAC;AACjE,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AACnD,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,WAAW,mBAAmB,CAAC"}

38
node_modules/jest-config/build/constants.js generated vendored Normal file
View file

@ -0,0 +1,38 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.JEST_CONFIG = exports.PACKAGE_JSON = exports.DEFAULT_REPORTER_LABEL = exports.DEFAULT_JS_PATTERN = exports.NODE_MODULES = void 0;
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const NODE_MODULES = _path().default.sep + 'node_modules' + _path().default.sep;
exports.NODE_MODULES = NODE_MODULES;
const DEFAULT_JS_PATTERN = '^.+\\.[jt]sx?$';
exports.DEFAULT_JS_PATTERN = DEFAULT_JS_PATTERN;
const DEFAULT_REPORTER_LABEL = 'default';
exports.DEFAULT_REPORTER_LABEL = DEFAULT_REPORTER_LABEL;
const PACKAGE_JSON = 'package.json';
exports.PACKAGE_JSON = PACKAGE_JSON;
const JEST_CONFIG = 'jest.config.js';
exports.JEST_CONFIG = JEST_CONFIG;

View 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.
*/
declare const getCacheDirectory: () => string;
export default getCacheDirectory;
//# sourceMappingURL=getCacheDirectory.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getCacheDirectory.d.ts","sourceRoot":"","sources":["../src/getCacheDirectory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,QAAA,MAAM,iBAAiB,cAWtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}

68
node_modules/jest-config/build/getCacheDirectory.js generated vendored Normal file
View file

@ -0,0 +1,68 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _os() {
const data = _interopRequireDefault(require('os'));
_os = function _os() {
return data;
};
return data;
}
function _realpathNative() {
const data = require('realpath-native');
_realpathNative = function _realpathNative() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const getCacheDirectory = () => {
const _process = process,
getuid = _process.getuid;
const tmpdir = _path().default.join(
(0, _realpathNative().sync)(_os().default.tmpdir()),
'jest'
);
if (getuid == null) {
return tmpdir;
} else {
// On some platforms tmpdir() is `/tmp`, causing conflicts between different
// users and permission issues. Adding an additional subdivision by UID can
// help.
return `${tmpdir}_${getuid.call(process).toString(36)}`;
}
};
var _default = getCacheDirectory;
exports.default = _default;

9
node_modules/jest-config/build/getMaxWorkers.d.ts generated vendored Normal file
View 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 { Config } from '@jest/types';
export default function getMaxWorkers(argv: Partial<Pick<Config.Argv, 'maxWorkers' | 'runInBand' | 'watch'>>): number;
//# sourceMappingURL=getMaxWorkers.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getMaxWorkers.d.ts","sourceRoot":"","sources":["../src/getMaxWorkers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC,CAAC,GACrE,MAAM,CAyBR"}

54
node_modules/jest-config/build/getMaxWorkers.js generated vendored Normal file
View file

@ -0,0 +1,54 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = getMaxWorkers;
function _os() {
const data = _interopRequireDefault(require('os'));
_os = function _os() {
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 getMaxWorkers(argv) {
if (argv.runInBand) {
return 1;
} else if (argv.maxWorkers) {
// TODO: How to type this properly? Should probably use `coerce` from `yargs`
const maxWorkers = argv.maxWorkers;
const parsed = parseInt(maxWorkers, 10);
if (
typeof maxWorkers === 'string' &&
maxWorkers.trim().endsWith('%') &&
parsed > 0 &&
parsed <= 100
) {
const cpus = _os().default.cpus().length;
const workers = Math.floor((parsed / 100) * cpus);
return workers >= 1 ? workers : 1;
}
return parsed > 0 ? parsed : 1;
} else {
// In watch mode, Jest should be unobtrusive and not use all available CPUs.
const cpus = _os().default.cpus() ? _os().default.cpus().length : 1;
return Math.max(argv.watch ? Math.floor(cpus / 2) : cpus - 1, 1);
}
}

26
node_modules/jest-config/build/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,26 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Config } from '@jest/types';
export { getTestEnvironment, isJSONString } from './utils';
export { default as normalize } from './normalize';
export { default as deprecationEntries } from './Deprecated';
export { replaceRootDirInPath } from './utils';
export { default as defaults } from './Defaults';
export { default as descriptions } from './Descriptions';
declare type ReadConfig = {
configPath: Config.Path | null | undefined;
globalConfig: Config.GlobalConfig;
hasDeprecationWarnings: boolean;
projectConfig: Config.ProjectConfig;
};
export declare function readConfig(argv: Config.Argv, packageRootOrConfig: Config.Path | Config.InitialOptions, skipArgvConfigOption?: boolean, parentConfigPath?: Config.Path | null, projectIndex?: number): ReadConfig;
export declare function readConfigs(argv: Config.Argv, projectPaths: Array<Config.Path>): {
globalConfig: Config.GlobalConfig;
configs: Array<Config.ProjectConfig>;
hasDeprecationWarnings: boolean;
};
//# sourceMappingURL=index.d.ts.map

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

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAMnC,OAAO,EAAC,kBAAkB,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACzD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEvD,aAAK,UAAU,GAAG;IAChB,UAAU,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC;IAClC,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC;CACrC,CAAC;AAEF,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,mBAAmB,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,cAAc,EAKxD,oBAAoB,CAAC,EAAE,OAAO,EAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,EACrC,YAAY,GAAE,MAAiB,GAC9B,UAAU,CAwDZ;AAsKD,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAC/B;IACD,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC;IAClC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACrC,sBAAsB,EAAE,OAAO,CAAC;CACjC,CAwEA"}

439
node_modules/jest-config/build/index.js generated vendored Normal file
View file

@ -0,0 +1,439 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.readConfig = readConfig;
exports.readConfigs = readConfigs;
Object.defineProperty(exports, 'getTestEnvironment', {
enumerable: true,
get: function get() {
return _utils.getTestEnvironment;
}
});
Object.defineProperty(exports, 'isJSONString', {
enumerable: true,
get: function get() {
return _utils.isJSONString;
}
});
Object.defineProperty(exports, 'replaceRootDirInPath', {
enumerable: true,
get: function get() {
return _utils.replaceRootDirInPath;
}
});
Object.defineProperty(exports, 'normalize', {
enumerable: true,
get: function get() {
return _normalize2.default;
}
});
Object.defineProperty(exports, 'deprecationEntries', {
enumerable: true,
get: function get() {
return _Deprecated.default;
}
});
Object.defineProperty(exports, 'defaults', {
enumerable: true,
get: function get() {
return _Defaults.default;
}
});
Object.defineProperty(exports, 'descriptions', {
enumerable: true,
get: function get() {
return _Descriptions.default;
}
});
function _fs() {
const data = _interopRequireDefault(require('fs'));
_fs = function _fs() {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
var _utils = require('./utils');
var _normalize2 = _interopRequireDefault(require('./normalize'));
var _resolveConfigPath = _interopRequireDefault(require('./resolveConfigPath'));
var _readConfigFileAndSetRootDir = _interopRequireDefault(
require('./readConfigFileAndSetRootDir')
);
var _Deprecated = _interopRequireDefault(require('./Deprecated'));
var _Defaults = _interopRequireDefault(require('./Defaults'));
var _Descriptions = _interopRequireDefault(require('./Descriptions'));
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 readConfig(
argv,
packageRootOrConfig, // Whether it needs to look into `--config` arg passed to CLI.
// It only used to read initial config. If the initial config contains
// `project` property, we don't want to read `--config` value and rather
skipArgvConfigOption,
parentConfigPath,
projectIndex = Infinity
) {
let rawOptions;
let configPath = null;
if (typeof packageRootOrConfig !== 'string') {
if (parentConfigPath) {
const parentConfigDirname = _path().default.dirname(parentConfigPath);
rawOptions = packageRootOrConfig;
rawOptions.rootDir = rawOptions.rootDir
? (0, _utils.replaceRootDirInPath)(
parentConfigDirname,
rawOptions.rootDir
)
: parentConfigDirname;
} else {
throw new Error(
'Jest: Cannot use configuration as an object without a file path.'
);
}
} else if ((0, _utils.isJSONString)(argv.config)) {
// A JSON string was passed to `--config` argument and we can parse it
// and use as is.
let config;
try {
config = JSON.parse(argv.config);
} catch (e) {
throw new Error(
'There was an error while parsing the `--config` argument as a JSON string.'
);
} // NOTE: we might need to resolve this dir to an absolute path in the future
config.rootDir = config.rootDir || packageRootOrConfig;
rawOptions = config; // A string passed to `--config`, which is either a direct path to the config
// or a path to directory containing `package.json` or `jest.config.js`
} else if (!skipArgvConfigOption && typeof argv.config == 'string') {
configPath = (0, _resolveConfigPath.default)(argv.config, process.cwd());
rawOptions = (0, _readConfigFileAndSetRootDir.default)(configPath);
} else {
// Otherwise just try to find config in the current rootDir.
configPath = (0, _resolveConfigPath.default)(
packageRootOrConfig,
process.cwd()
);
rawOptions = (0, _readConfigFileAndSetRootDir.default)(configPath);
}
const _normalize = (0, _normalize2.default)(
rawOptions,
argv,
configPath,
projectIndex
),
options = _normalize.options,
hasDeprecationWarnings = _normalize.hasDeprecationWarnings;
const _groupOptions = groupOptions(options),
globalConfig = _groupOptions.globalConfig,
projectConfig = _groupOptions.projectConfig;
return {
configPath,
globalConfig,
hasDeprecationWarnings,
projectConfig
};
}
const groupOptions = options => ({
globalConfig: Object.freeze({
bail: options.bail,
changedFilesWithAncestor: options.changedFilesWithAncestor,
changedSince: options.changedSince,
collectCoverage: options.collectCoverage,
collectCoverageFrom: options.collectCoverageFrom,
collectCoverageOnlyFrom: options.collectCoverageOnlyFrom,
coverageDirectory: options.coverageDirectory,
coverageReporters: options.coverageReporters,
coverageThreshold: options.coverageThreshold,
detectLeaks: options.detectLeaks,
detectOpenHandles: options.detectOpenHandles,
enabledTestsMap: options.enabledTestsMap,
errorOnDeprecated: options.errorOnDeprecated,
expand: options.expand,
extraGlobals: options.extraGlobals,
filter: options.filter,
findRelatedTests: options.findRelatedTests,
forceExit: options.forceExit,
globalSetup: options.globalSetup,
globalTeardown: options.globalTeardown,
json: options.json,
lastCommit: options.lastCommit,
listTests: options.listTests,
logHeapUsage: options.logHeapUsage,
maxConcurrency: options.maxConcurrency,
maxWorkers: options.maxWorkers,
noSCM: undefined,
noStackTrace: options.noStackTrace,
nonFlagArgs: options.nonFlagArgs,
notify: options.notify,
notifyMode: options.notifyMode,
onlyChanged: options.onlyChanged,
onlyFailures: options.onlyFailures,
outputFile: options.outputFile,
passWithNoTests: options.passWithNoTests,
projects: options.projects,
replname: options.replname,
reporters: options.reporters,
rootDir: options.rootDir,
runTestsByPath: options.runTestsByPath,
silent: options.silent,
skipFilter: options.skipFilter,
testFailureExitCode: options.testFailureExitCode,
testNamePattern: options.testNamePattern,
testPathPattern: options.testPathPattern,
testResultsProcessor: options.testResultsProcessor,
testSequencer: options.testSequencer,
updateSnapshot: options.updateSnapshot,
useStderr: options.useStderr,
verbose: options.verbose,
watch: options.watch,
watchAll: options.watchAll,
watchPlugins: options.watchPlugins,
watchman: options.watchman
}),
projectConfig: Object.freeze({
automock: options.automock,
browser: options.browser,
cache: options.cache,
cacheDirectory: options.cacheDirectory,
clearMocks: options.clearMocks,
coveragePathIgnorePatterns: options.coveragePathIgnorePatterns,
cwd: options.cwd,
dependencyExtractor: options.dependencyExtractor,
detectLeaks: options.detectLeaks,
detectOpenHandles: options.detectOpenHandles,
displayName: options.displayName,
errorOnDeprecated: options.errorOnDeprecated,
extraGlobals: options.extraGlobals,
filter: options.filter,
forceCoverageMatch: options.forceCoverageMatch,
globalSetup: options.globalSetup,
globalTeardown: options.globalTeardown,
globals: options.globals,
haste: options.haste,
moduleDirectories: options.moduleDirectories,
moduleFileExtensions: options.moduleFileExtensions,
moduleLoader: options.moduleLoader,
moduleNameMapper: options.moduleNameMapper,
modulePathIgnorePatterns: options.modulePathIgnorePatterns,
modulePaths: options.modulePaths,
name: options.name,
prettierPath: options.prettierPath,
resetMocks: options.resetMocks,
resetModules: options.resetModules,
resolver: options.resolver,
restoreMocks: options.restoreMocks,
rootDir: options.rootDir,
roots: options.roots,
runner: options.runner,
setupFiles: options.setupFiles,
setupFilesAfterEnv: options.setupFilesAfterEnv,
skipFilter: options.skipFilter,
skipNodeResolution: options.skipNodeResolution,
snapshotResolver: options.snapshotResolver,
snapshotSerializers: options.snapshotSerializers,
testEnvironment: options.testEnvironment,
testEnvironmentOptions: options.testEnvironmentOptions,
testLocationInResults: options.testLocationInResults,
testMatch: options.testMatch,
testPathIgnorePatterns: options.testPathIgnorePatterns,
testRegex: options.testRegex,
testRunner: options.testRunner,
testURL: options.testURL,
timers: options.timers,
transform: options.transform,
transformIgnorePatterns: options.transformIgnorePatterns,
unmockedModulePathPatterns: options.unmockedModulePathPatterns,
watchPathIgnorePatterns: options.watchPathIgnorePatterns
})
});
const ensureNoDuplicateConfigs = (parsedConfigs, projects) => {
if (projects.length <= 1) {
return;
}
const configPathMap = new Map();
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (
var _iterator = parsedConfigs[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
_iteratorNormalCompletion = true
) {
const config = _step.value;
const configPath = config.configPath;
if (configPathMap.has(configPath)) {
const message = `Whoops! Two projects resolved to the same config path: ${_chalk().default.bold(
String(configPath)
)}:
Project 1: ${_chalk().default.bold(
projects[parsedConfigs.findIndex(x => x === config)]
)}
Project 2: ${_chalk().default.bold(
projects[parsedConfigs.findIndex(x => x === configPathMap.get(configPath))]
)}
This usually means that your ${_chalk().default.bold(
'"projects"'
)} config includes a directory that doesn't have any configuration recognizable by Jest. Please fix it.
`;
throw new Error(message);
}
if (configPath !== null) {
configPathMap.set(configPath, config);
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}; // Possible scenarios:
// 1. jest --config config.json
// 2. jest --projects p1 p2
// 3. jest --projects p1 p2 --config config.json
// 4. jest --projects p1
// 5. jest
//
// If no projects are specified, process.cwd() will be used as the default
// (and only) project.
function readConfigs(argv, projectPaths) {
let globalConfig;
let hasDeprecationWarnings;
let configs = [];
let projects = projectPaths;
let configPath;
if (projectPaths.length === 1) {
const parsedConfig = readConfig(argv, projects[0]);
configPath = parsedConfig.configPath;
if (parsedConfig.globalConfig.projects) {
// If this was a single project, and its config has `projects`
// settings, use that value instead.
projects = parsedConfig.globalConfig.projects;
}
hasDeprecationWarnings = parsedConfig.hasDeprecationWarnings;
globalConfig = parsedConfig.globalConfig;
configs = [parsedConfig.projectConfig];
if (globalConfig.projects && globalConfig.projects.length) {
// Even though we had one project in CLI args, there might be more
// projects defined in the config.
projects = globalConfig.projects;
}
}
if (
projects.length > 1 ||
(projects.length && typeof projects[0] === 'object')
) {
const parsedConfigs = projects
.filter(root => {
// Ignore globbed files that cannot be `require`d.
if (
typeof root === 'string' &&
_fs().default.existsSync(root) &&
!_fs()
.default.lstatSync(root)
.isDirectory() &&
!root.endsWith('.js') &&
!root.endsWith('.json')
) {
return false;
}
return true;
})
.map((root, projectIndex) =>
readConfig(argv, root, true, configPath, projectIndex)
);
ensureNoDuplicateConfigs(parsedConfigs, projects);
configs = parsedConfigs.map(({projectConfig}) => projectConfig);
if (!hasDeprecationWarnings) {
hasDeprecationWarnings = parsedConfigs.some(
({hasDeprecationWarnings}) => !!hasDeprecationWarnings
);
} // If no config was passed initially, use the one from the first project
if (!globalConfig) {
globalConfig = parsedConfigs[0].globalConfig;
}
}
if (!globalConfig || !configs.length) {
throw new Error('jest: No configuration found for any project.');
}
return {
configs,
globalConfig,
hasDeprecationWarnings: !!hasDeprecationWarnings
};
}

14
node_modules/jest-config/build/normalize.d.ts generated vendored Normal file
View file

@ -0,0 +1,14 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Config } from '@jest/types';
declare type AllOptions = Config.ProjectConfig & Config.GlobalConfig;
export default function normalize(options: Config.InitialOptions, argv: Config.Argv, configPath?: Config.Path | null, projectIndex?: number): {
hasDeprecationWarnings: boolean;
options: AllOptions;
};
export {};
//# sourceMappingURL=normalize.d.ts.map

1
node_modules/jest-config/build/normalize.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAiCnC,aAAK,UAAU,GAAG,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;AAwW7D,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,OAAO,EAAE,MAAM,CAAC,cAAc,EAC9B,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,UAAU,CAAC,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,EAC/B,YAAY,GAAE,MAAiB,GAC9B;IACD,sBAAsB,EAAE,OAAO,CAAC;IAChC,OAAO,EAAE,UAAU,CAAC;CACrB,CAkjBA"}

1102
node_modules/jest-config/build/normalize.js generated vendored Normal file

File diff suppressed because it is too large Load diff

View 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 { Config } from '@jest/types';
declare const _default: (configPath: string) => Config.InitialOptions;
export default _default;
//# sourceMappingURL=readConfigFileAndSetRootDir.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"readConfigFileAndSetRootDir.d.ts","sourceRoot":"","sources":["../src/readConfigFileAndSetRootDir.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;;AAQnC,wBAsCE"}

View file

@ -0,0 +1,88 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _fs() {
const data = _interopRequireDefault(require('fs'));
_fs = function _fs() {
return data;
};
return data;
}
var _jsonlint = _interopRequireDefault(require('./vendor/jsonlint'));
var _constants = require('./constants');
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.
*/
// @ts-ignore: vendored
// Read the configuration and set its `rootDir`
// 1. If it's a `package.json` file, we look into its "jest" property
// 2. For any other file, we just require it.
var _default = configPath => {
const isJSON = configPath.endsWith('.json');
let configObject;
try {
configObject = require(configPath);
} catch (error) {
if (isJSON) {
throw new Error(
`Jest: Failed to parse config file ${configPath}\n` +
` ${_jsonlint.default.errors(
_fs().default.readFileSync(configPath, 'utf8')
)}`
);
} else {
throw error;
}
}
if (configPath.endsWith(_constants.PACKAGE_JSON)) {
// Event if there's no "jest" property in package.json we will still use
// an empty object.
configObject = configObject.jest || {};
}
if (configObject.rootDir) {
// We don't touch it if it has an absolute path specified
if (!_path().default.isAbsolute(configObject.rootDir)) {
// otherwise, we'll resolve it relative to the file's __dirname
configObject.rootDir = _path().default.resolve(
_path().default.dirname(configPath),
configObject.rootDir
);
}
} else {
// If rootDir is not there, we'll set it to this file's __dirname
configObject.rootDir = _path().default.dirname(configPath);
}
return configObject;
};
exports.default = _default;

View 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.
*/
declare const _default: (pathToResolve: string, cwd: string) => string;
export default _default;
//# sourceMappingURL=resolveConfigPath.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"resolveConfigPath.d.ts","sourceRoot":"","sources":["../src/resolveConfigPath.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAUH,wBA+BE"}

121
node_modules/jest-config/build/resolveConfigPath.js generated vendored Normal file
View file

@ -0,0 +1,121 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _fs() {
const data = _interopRequireDefault(require('fs'));
_fs = function _fs() {
return data;
};
return data;
}
var _constants = require('./constants');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const isFile = filePath =>
_fs().default.existsSync(filePath) &&
!_fs()
.default.lstatSync(filePath)
.isDirectory();
var _default = (pathToResolve, cwd) => {
if (!_path().default.isAbsolute(cwd)) {
throw new Error(`"cwd" must be an absolute path. cwd: ${cwd}`);
}
const absolutePath = _path().default.isAbsolute(pathToResolve)
? pathToResolve
: _path().default.resolve(cwd, pathToResolve);
if (isFile(absolutePath)) {
return absolutePath;
} // This is a guard against passing non existing path as a project/config,
// that will otherwise result in a very confusing situation.
// e.g.
// With a directory structure like this:
// my_project/
// packcage.json
//
// Passing a `my_project/some_directory_that_doesnt_exist` as a project
// name will resolve into a (possibly empty) `my_project/package.json` and
// try to run all tests it finds under `my_project` directory.
if (!_fs().default.existsSync(absolutePath)) {
throw new Error(
`Can't find a root directory while resolving a config file path.\n` +
`Provided path to resolve: ${pathToResolve}\n` +
`cwd: ${cwd}`
);
}
return resolveConfigPathByTraversing(absolutePath, pathToResolve, cwd);
};
exports.default = _default;
const resolveConfigPathByTraversing = (pathToResolve, initialPath, cwd) => {
const jestConfig = _path().default.resolve(
pathToResolve,
_constants.JEST_CONFIG
);
if (isFile(jestConfig)) {
return jestConfig;
}
const packageJson = _path().default.resolve(
pathToResolve,
_constants.PACKAGE_JSON
);
if (isFile(packageJson)) {
return packageJson;
} // This is the system root.
// We tried everything, config is nowhere to be found ¯\_(ツ)_/¯
if (pathToResolve === _path().default.dirname(pathToResolve)) {
throw new Error(makeResolutionErrorMessage(initialPath, cwd));
} // go up a level and try it again
return resolveConfigPathByTraversing(
_path().default.dirname(pathToResolve),
initialPath,
cwd
);
};
const makeResolutionErrorMessage = (initialPath, cwd) =>
'Could not find a config file based on provided values:\n' +
`path: "${initialPath}"\n` +
`cwd: "${cwd}"\n` +
'Config paths must be specified by either a direct path to a config\n' +
'file, or a path to a directory. If directory is given, Jest will try to\n' +
`traverse directory tree up, until it finds either "${
_constants.JEST_CONFIG
}" or\n` +
`"${_constants.PACKAGE_JSON}".`;

9
node_modules/jest-config/build/setFromArgv.d.ts generated vendored Normal file
View 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 { Config } from '@jest/types';
export default function setFromArgv(options: Config.InitialOptions, argv: Config.Argv): Config.InitialOptions;
//# sourceMappingURL=setFromArgv.d.ts.map

1
node_modules/jest-config/build/setFromArgv.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"setFromArgv.d.ts","sourceRoot":"","sources":["../src/setFromArgv.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAKnC,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,OAAO,EAAE,MAAM,CAAC,cAAc,EAC9B,IAAI,EAAE,MAAM,CAAC,IAAI,GAChB,MAAM,CAAC,cAAc,CAyCvB"}

100
node_modules/jest-config/build/setFromArgv.js generated vendored Normal file
View file

@ -0,0 +1,100 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = setFromArgv;
var _utils = require('./utils');
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* 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 specialArgs = ['_', '$0', 'h', 'help', 'config'];
function setFromArgv(options, argv) {
const argvToOptions = Object.keys(argv)
.filter(key => argv[key] !== undefined && specialArgs.indexOf(key) === -1)
.reduce((options, key) => {
switch (key) {
case 'coverage':
options.collectCoverage = argv[key];
break;
case 'json':
options.useStderr = argv[key];
break;
case 'watchAll':
options.watch = false;
options.watchAll = argv[key];
break;
case 'env':
options.testEnvironment = argv[key];
break;
case 'config':
break;
case 'coverageThreshold':
case 'globals':
case 'moduleNameMapper':
case 'transform':
case 'haste':
const str = argv[key];
if ((0, _utils.isJSONString)(str)) {
options[key] = JSON.parse(str);
}
break;
default:
options[key] = argv[key];
}
return options;
}, {});
return _objectSpread(
{},
options,
(0, _utils.isJSONString)(argv.config) ? JSON.parse(argv.config) : null,
argvToOptions
);
}

72
node_modules/jest-config/build/utils.d.ts generated vendored Normal file
View file

@ -0,0 +1,72 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Config } from '@jest/types';
declare type ResolveOptions = {
rootDir: Config.Path;
key: string;
filePath: Config.Path;
optional?: boolean;
};
export declare const BULLET: string;
export declare const DOCUMENTATION_NOTE: string;
export declare const resolve: (resolver: string | null | undefined, { key, filePath, rootDir, optional }: ResolveOptions) => string | null;
export declare const escapeGlobCharacters: (path: string) => string;
export declare const replaceRootDirInPath: (rootDir: string, filePath: string) => string;
export declare const _replaceRootDirTags: (rootDir: string, config: any) => any;
export declare const resolveWithPrefix: (resolver: string | null | undefined, { filePath, humanOptionName, optionName, prefix, rootDir, }: {
filePath: string;
humanOptionName: string;
optionName: string;
prefix: string;
rootDir: string;
}) => string;
/**
* Finds the test environment to use:
*
* 1. looks for jest-environment-<name> relative to project.
* 1. looks for jest-environment-<name> relative to Jest.
* 1. looks for <name> relative to project.
* 1. looks for <name> relative to Jest.
*/
export declare const getTestEnvironment: ({ rootDir, testEnvironment: filePath, }: {
rootDir: string;
testEnvironment: string;
}) => string;
/**
* Finds the watch plugins to use:
*
* 1. looks for jest-watch-<name> relative to project.
* 1. looks for jest-watch-<name> relative to Jest.
* 1. looks for <name> relative to project.
* 1. looks for <name> relative to Jest.
*/
export declare const getWatchPlugin: (resolver: string | null | undefined, { filePath, rootDir }: {
filePath: string;
rootDir: string;
}) => string;
/**
* Finds the runner to use:
*
* 1. looks for jest-runner-<name> relative to project.
* 1. looks for jest-runner-<name> relative to Jest.
* 1. looks for <name> relative to project.
* 1. looks for <name> relative to Jest.
*/
export declare const getRunner: (resolver: string | null | undefined, { filePath, rootDir }: {
filePath: string;
rootDir: string;
}) => string;
declare type JSONString = string & {
readonly $$type: never;
};
export declare const isJSONString: (text?: string | JSONString | undefined) => text is JSONString;
export declare const getSequencer: (resolver: string | null | undefined, { filePath, rootDir }: {
filePath: string;
rootDir: string;
}) => string;
export {};
//# sourceMappingURL=utils.d.ts.map

1
node_modules/jest-config/build/utils.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAKnC,aAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAA8B,CAAC;AACpD,eAAO,MAAM,kBAAkB,QAI9B,CAAC;AAKF,eAAO,MAAM,OAAO,8GAsBnB,CAAC;AAEF,eAAO,MAAM,oBAAoB,0BACW,CAAC;AAE7C,eAAO,MAAM,oBAAoB,+CAYhC,CAAC;AAqBF,eAAO,MAAM,mBAAmB,uCAc/B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;YAgD7B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;YAa3B,CAAC;AAEL;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;YAUvB,CAAC;AAEL;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS;;;YAUlB,CAAC;AAEL,aAAK,UAAU,GAAG,MAAM,GAAG;IAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAA;CAAC,CAAC;AACpD,eAAO,MAAM,YAAY,gEAIL,CAAC;AAErB,eAAO,MAAM,YAAY;;;YAUrB,CAAC"}

270
node_modules/jest-config/build/utils.js generated vendored Normal file
View file

@ -0,0 +1,270 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.getSequencer = exports.isJSONString = exports.getRunner = exports.getWatchPlugin = exports.getTestEnvironment = exports.resolveWithPrefix = exports._replaceRootDirTags = exports.replaceRootDirInPath = exports.escapeGlobCharacters = exports.resolve = exports.DOCUMENTATION_NOTE = exports.BULLET = void 0;
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _jestValidate() {
const data = require('jest-validate');
_jestValidate = function _jestValidate() {
return data;
};
return data;
}
function _jestResolve() {
const data = _interopRequireDefault(require('jest-resolve'));
_jestResolve = function _jestResolve() {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const BULLET = _chalk().default.bold('\u25cf ');
exports.BULLET = BULLET;
const DOCUMENTATION_NOTE = ` ${_chalk().default.bold(
'Configuration Documentation:'
)}
https://jestjs.io/docs/configuration.html
`;
exports.DOCUMENTATION_NOTE = DOCUMENTATION_NOTE;
const createValidationError = message =>
new (_jestValidate()).ValidationError(
`${BULLET}Validation Error`,
message,
DOCUMENTATION_NOTE
);
const resolve = (resolver, {key, filePath, rootDir, optional}) => {
const module = _jestResolve().default.findNodeModule(
replaceRootDirInPath(rootDir, filePath),
{
basedir: rootDir,
resolver: resolver || undefined
}
);
if (!module && !optional) {
throw createValidationError(` Module ${_chalk().default.bold(
filePath
)} in the ${_chalk().default.bold(key)} option was not found.
${_chalk().default.bold('<rootDir>')} is: ${rootDir}`);
}
return module;
};
exports.resolve = resolve;
const escapeGlobCharacters = path => path.replace(/([()*{}\[\]!?\\])/g, '\\$1');
exports.escapeGlobCharacters = escapeGlobCharacters;
const replaceRootDirInPath = (rootDir, filePath) => {
if (!/^<rootDir>/.test(filePath)) {
return filePath;
}
return _path().default.resolve(
rootDir,
_path().default.normalize('./' + filePath.substr('<rootDir>'.length))
);
}; // TODO: Type as returning same type as input
exports.replaceRootDirInPath = replaceRootDirInPath;
const _replaceRootDirInObject = (rootDir, config) => {
if (config !== null) {
const newConfig = {};
for (const configKey in config) {
newConfig[configKey] =
configKey === 'rootDir'
? config[configKey]
: _replaceRootDirTags(rootDir, config[configKey]);
}
return newConfig;
}
return config;
}; // TODO: Type as returning same type as input
const _replaceRootDirTags = (rootDir, config) => {
switch (typeof config) {
case 'object':
if (Array.isArray(config)) {
return config.map(item => _replaceRootDirTags(rootDir, item));
}
if (config instanceof RegExp) {
return config;
}
return _replaceRootDirInObject(rootDir, config);
case 'string':
return replaceRootDirInPath(rootDir, config);
}
return config;
};
exports._replaceRootDirTags = _replaceRootDirTags;
const resolveWithPrefix = (
resolver,
{filePath, humanOptionName, optionName, prefix, rootDir}
) => {
const fileName = replaceRootDirInPath(rootDir, filePath);
let module = _jestResolve().default.findNodeModule(`${prefix}${fileName}`, {
basedir: rootDir,
resolver: resolver || undefined
});
if (module) {
return module;
}
try {
return require.resolve(`${prefix}${fileName}`);
} catch (e) {}
module = _jestResolve().default.findNodeModule(fileName, {
basedir: rootDir,
resolver: resolver || undefined
});
if (module) {
return module;
}
try {
return require.resolve(fileName);
} catch (e) {}
throw createValidationError(
` ${humanOptionName} ${_chalk().default.bold(
fileName
)} cannot be found. Make sure the ${_chalk().default.bold(
optionName
)} configuration option points to an existing node module.`
);
};
/**
* Finds the test environment to use:
*
* 1. looks for jest-environment-<name> relative to project.
* 1. looks for jest-environment-<name> relative to Jest.
* 1. looks for <name> relative to project.
* 1. looks for <name> relative to Jest.
*/
exports.resolveWithPrefix = resolveWithPrefix;
const getTestEnvironment = ({rootDir, testEnvironment: filePath}) =>
resolveWithPrefix(undefined, {
filePath,
humanOptionName: 'Test environment',
optionName: 'testEnvironment',
prefix: 'jest-environment-',
rootDir
});
/**
* Finds the watch plugins to use:
*
* 1. looks for jest-watch-<name> relative to project.
* 1. looks for jest-watch-<name> relative to Jest.
* 1. looks for <name> relative to project.
* 1. looks for <name> relative to Jest.
*/
exports.getTestEnvironment = getTestEnvironment;
const getWatchPlugin = (resolver, {filePath, rootDir}) =>
resolveWithPrefix(resolver, {
filePath,
humanOptionName: 'Watch plugin',
optionName: 'watchPlugins',
prefix: 'jest-watch-',
rootDir
});
/**
* Finds the runner to use:
*
* 1. looks for jest-runner-<name> relative to project.
* 1. looks for jest-runner-<name> relative to Jest.
* 1. looks for <name> relative to project.
* 1. looks for <name> relative to Jest.
*/
exports.getWatchPlugin = getWatchPlugin;
const getRunner = (resolver, {filePath, rootDir}) =>
resolveWithPrefix(resolver, {
filePath,
humanOptionName: 'Jest Runner',
optionName: 'runner',
prefix: 'jest-runner-',
rootDir
});
exports.getRunner = getRunner;
// newtype
const isJSONString = text =>
text != null &&
typeof text === 'string' &&
text.startsWith('{') &&
text.endsWith('}');
exports.isJSONString = isJSONString;
const getSequencer = (resolver, {filePath, rootDir}) =>
resolveWithPrefix(resolver, {
filePath,
humanOptionName: 'Jest Sequencer',
optionName: 'testSequencer',
prefix: 'jest-sequencer-',
rootDir
});
exports.getSequencer = getSequencer;

8
node_modules/jest-config/build/validatePattern.d.ts generated vendored Normal file
View 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.
*/
export default function validatePattern(pattern?: string): boolean;
//# sourceMappingURL=validatePattern.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"validatePattern.d.ts","sourceRoot":"","sources":["../src/validatePattern.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,WAWvD"}

25
node_modules/jest-config/build/validatePattern.js generated vendored Normal file
View file

@ -0,0 +1,25 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = validatePattern;
/**
* 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 validatePattern(pattern) {
if (pattern) {
try {
// eslint-disable-next-line no-new
new RegExp(pattern, 'i');
} catch (e) {
return false;
}
}
return true;
}

917
node_modules/jest-config/build/vendor/jsonlint.js generated vendored Normal file
View file

@ -0,0 +1,917 @@
'use strict';
// From: https://github.com/zaach/jsonlint
// Vendored in Jest to avoid jsonlint's transitive dependencies.
/* eslint-disable */
var jsonlint = (function() {
var parser = {
trace: function trace() {},
yy: {},
symbols_: {
error: 2,
JSONString: 3,
STRING: 4,
JSONNumber: 5,
NUMBER: 6,
JSONNullLiteral: 7,
NULL: 8,
JSONBooleanLiteral: 9,
TRUE: 10,
FALSE: 11,
JSONText: 12,
JSONValue: 13,
EOF: 14,
JSONObject: 15,
JSONArray: 16,
'{': 17,
'}': 18,
JSONMemberList: 19,
JSONMember: 20,
':': 21,
',': 22,
'[': 23,
']': 24,
JSONElementList: 25,
$accept: 0,
$end: 1
},
terminals_: {
2: 'error',
4: 'STRING',
6: 'NUMBER',
8: 'NULL',
10: 'TRUE',
11: 'FALSE',
14: 'EOF',
17: '{',
18: '}',
21: ':',
22: ',',
23: '[',
24: ']'
},
productions_: [
0,
[3, 1],
[5, 1],
[7, 1],
[9, 1],
[9, 1],
[12, 2],
[13, 1],
[13, 1],
[13, 1],
[13, 1],
[13, 1],
[13, 1],
[15, 2],
[15, 3],
[20, 3],
[19, 1],
[19, 3],
[16, 2],
[16, 3],
[25, 1],
[25, 3]
],
performAction: function anonymous(
yytext,
yyleng,
yylineno,
yy,
yystate,
$$,
_$
) {
var $0 = $$.length - 1;
switch (yystate) {
case 1:
// replace escaped characters with actual character
this.$ = yytext
.replace(/\\(\\|")/g, '$' + '1')
.replace(/\\n/g, '\n')
.replace(/\\r/g, '\r')
.replace(/\\t/g, '\t')
.replace(/\\v/g, '\v')
.replace(/\\f/g, '\f')
.replace(/\\b/g, '\b');
break;
case 2:
this.$ = Number(yytext);
break;
case 3:
this.$ = null;
break;
case 4:
this.$ = true;
break;
case 5:
this.$ = false;
break;
case 6:
return (this.$ = $$[$0 - 1]);
break;
case 13:
this.$ = {};
break;
case 14:
this.$ = $$[$0 - 1];
break;
case 15:
this.$ = [$$[$0 - 2], $$[$0]];
break;
case 16:
this.$ = {};
this.$[$$[$0][0]] = $$[$0][1];
break;
case 17:
this.$ = $$[$0 - 2];
$$[$0 - 2][$$[$0][0]] = $$[$0][1];
break;
case 18:
this.$ = [];
break;
case 19:
this.$ = $$[$0 - 1];
break;
case 20:
this.$ = [$$[$0]];
break;
case 21:
this.$ = $$[$0 - 2];
$$[$0 - 2].push($$[$0]);
break;
}
},
table: [
{
3: 5,
4: [1, 12],
5: 6,
6: [1, 13],
7: 3,
8: [1, 9],
9: 4,
10: [1, 10],
11: [1, 11],
12: 1,
13: 2,
15: 7,
16: 8,
17: [1, 14],
23: [1, 15]
},
{
1: [3]
},
{
14: [1, 16]
},
{
14: [2, 7],
18: [2, 7],
22: [2, 7],
24: [2, 7]
},
{
14: [2, 8],
18: [2, 8],
22: [2, 8],
24: [2, 8]
},
{
14: [2, 9],
18: [2, 9],
22: [2, 9],
24: [2, 9]
},
{
14: [2, 10],
18: [2, 10],
22: [2, 10],
24: [2, 10]
},
{
14: [2, 11],
18: [2, 11],
22: [2, 11],
24: [2, 11]
},
{
14: [2, 12],
18: [2, 12],
22: [2, 12],
24: [2, 12]
},
{
14: [2, 3],
18: [2, 3],
22: [2, 3],
24: [2, 3]
},
{
14: [2, 4],
18: [2, 4],
22: [2, 4],
24: [2, 4]
},
{
14: [2, 5],
18: [2, 5],
22: [2, 5],
24: [2, 5]
},
{
14: [2, 1],
18: [2, 1],
21: [2, 1],
22: [2, 1],
24: [2, 1]
},
{
14: [2, 2],
18: [2, 2],
22: [2, 2],
24: [2, 2]
},
{
3: 20,
4: [1, 12],
18: [1, 17],
19: 18,
20: 19
},
{
3: 5,
4: [1, 12],
5: 6,
6: [1, 13],
7: 3,
8: [1, 9],
9: 4,
10: [1, 10],
11: [1, 11],
13: 23,
15: 7,
16: 8,
17: [1, 14],
23: [1, 15],
24: [1, 21],
25: 22
},
{
1: [2, 6]
},
{
14: [2, 13],
18: [2, 13],
22: [2, 13],
24: [2, 13]
},
{
18: [1, 24],
22: [1, 25]
},
{
18: [2, 16],
22: [2, 16]
},
{
21: [1, 26]
},
{
14: [2, 18],
18: [2, 18],
22: [2, 18],
24: [2, 18]
},
{
22: [1, 28],
24: [1, 27]
},
{
22: [2, 20],
24: [2, 20]
},
{
14: [2, 14],
18: [2, 14],
22: [2, 14],
24: [2, 14]
},
{
3: 20,
4: [1, 12],
20: 29
},
{
3: 5,
4: [1, 12],
5: 6,
6: [1, 13],
7: 3,
8: [1, 9],
9: 4,
10: [1, 10],
11: [1, 11],
13: 30,
15: 7,
16: 8,
17: [1, 14],
23: [1, 15]
},
{
14: [2, 19],
18: [2, 19],
22: [2, 19],
24: [2, 19]
},
{
3: 5,
4: [1, 12],
5: 6,
6: [1, 13],
7: 3,
8: [1, 9],
9: 4,
10: [1, 10],
11: [1, 11],
13: 31,
15: 7,
16: 8,
17: [1, 14],
23: [1, 15]
},
{
18: [2, 17],
22: [2, 17]
},
{
18: [2, 15],
22: [2, 15]
},
{
22: [2, 21],
24: [2, 21]
}
],
defaultActions: {
16: [2, 6]
},
parseError: function parseError(str, hash) {
throw new Error(str);
},
parse: function parse(input) {
var self = this,
stack = [0],
vstack = [null],
// semantic value stack
lstack = [],
// location stack
table = this.table,
yytext = '',
yylineno = 0,
yyleng = 0,
recovering = 0,
TERROR = 2,
EOF = 1; //this.reductionCount = this.shiftCount = 0;
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
if (typeof this.lexer.yylloc == 'undefined') this.lexer.yylloc = {};
var yyloc = this.lexer.yylloc;
lstack.push(yyloc);
if (typeof this.yy.parseError === 'function')
this.parseError = this.yy.parseError;
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
function lex() {
var token;
token = self.lexer.lex() || 1; // $end = 1
// if token isn't its numeric value, convert
if (typeof token !== 'number') {
token = self.symbols_[token] || token;
}
return token;
}
var symbol,
preErrorSymbol,
state,
action,
a,
r,
yyval = {},
p,
len,
newState,
expected;
while (true) {
// retrieve state number from top of stack
state = stack[stack.length - 1]; // use default actions if available
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol == null) symbol = lex(); // read action for current state and first input
action = table[state] && table[state][symbol];
} // handle parse error
_handle_error: if (
typeof action === 'undefined' ||
!action.length ||
!action[0]
) {
if (!recovering) {
// Report error
expected = [];
for (p in table[state])
if (this.terminals_[p] && p > 2) {
expected.push("'" + this.terminals_[p] + "'");
}
var errStr = '';
if (this.lexer.showPosition) {
errStr =
'Parse error on line ' +
(yylineno + 1) +
':\n' +
this.lexer.showPosition() +
'\nExpecting ' +
expected.join(', ') +
", got '" +
this.terminals_[symbol] +
"'";
} else {
errStr =
'Parse error on line ' +
(yylineno + 1) +
': Unexpected ' +
(symbol == 1
? /*EOF*/
'end of input'
: "'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, {
text: this.lexer.match,
token: this.terminals_[symbol] || symbol,
line: this.lexer.yylineno,
loc: yyloc,
expected: expected
});
} // just recovered from another error
if (recovering == 3) {
if (symbol == EOF) {
throw new Error(errStr || 'Parsing halted.');
} // discard current lookahead and grab another
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
yyloc = this.lexer.yylloc;
symbol = lex();
} // try to recover from error
while (1) {
// check for error recovery rule in this state
if (TERROR.toString() in table[state]) {
break;
}
if (state == 0) {
throw new Error(errStr || 'Parsing halted.');
}
popStack(1);
state = stack[stack.length - 1];
}
preErrorSymbol = symbol; // save the lookahead token
symbol = TERROR; // insert generic error symbol as new lookahead
state = stack[stack.length - 1];
action = table[state] && table[state][TERROR];
recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
} // this shouldn't happen, unless resolve defaults are off
if (action[0] instanceof Array && action.length > 1) {
throw new Error(
'Parse Error: multiple actions possible at state: ' +
state +
', token: ' +
symbol
);
}
switch (action[0]) {
case 1:
// shift
//this.shiftCount++;
stack.push(symbol);
vstack.push(this.lexer.yytext);
lstack.push(this.lexer.yylloc);
stack.push(action[1]); // push state
symbol = null;
if (!preErrorSymbol) {
// normal execution/no error
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
yyloc = this.lexer.yylloc;
if (recovering > 0) recovering--;
} else {
// error just occurred, resume old lookahead f/ before error
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
// reduce
//this.reductionCount++;
len = this.productions_[action[1]][1]; // perform semantic action
yyval.$ = vstack[vstack.length - len]; // default to $$ = $1
// default location, uses first token for firsts, last for lasts
yyval._$ = {
first_line: lstack[lstack.length - (len || 1)].first_line,
last_line: lstack[lstack.length - 1].last_line,
first_column: lstack[lstack.length - (len || 1)].first_column,
last_column: lstack[lstack.length - 1].last_column
};
r = this.performAction.call(
yyval,
yytext,
yyleng,
yylineno,
this.yy,
action[1],
vstack,
lstack
);
if (typeof r !== 'undefined') {
return r;
} // pop off stack
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
vstack.push(yyval.$);
lstack.push(yyval._$); // goto new state = table[STATE][NONTERMINAL]
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
// accept
return true;
}
}
return true;
}
};
/* Jison generated lexer */
var lexer = (function() {
var lexer = {
EOF: 1,
parseError: function parseError(str, hash) {
if (this.yy.parseError) {
this.yy.parseError(str, hash);
} else {
throw new Error(str);
}
},
setInput: function setInput(input) {
this._input = input;
this._more = this._less = this.done = false;
this.yylineno = this.yyleng = 0;
this.yytext = this.matched = this.match = '';
this.conditionStack = ['INITIAL'];
this.yylloc = {
first_line: 1,
first_column: 0,
last_line: 1,
last_column: 0
};
return this;
},
input: function input() {
var ch = this._input[0];
this.yytext += ch;
this.yyleng++;
this.match += ch;
this.matched += ch;
var lines = ch.match(/\n/);
if (lines) this.yylineno++;
this._input = this._input.slice(1);
return ch;
},
unput: function unput(ch) {
this._input = ch + this._input;
return this;
},
more: function more() {
this._more = true;
return this;
},
less: function less(n) {
this._input = this.match.slice(n) + this._input;
},
pastInput: function pastInput() {
var past = this.matched.substr(
0,
this.matched.length - this.match.length
);
return (
(past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '')
);
},
upcomingInput: function upcomingInput() {
var next = this.match;
if (next.length < 20) {
next += this._input.substr(0, 20 - next.length);
}
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(
/\n/g,
''
);
},
showPosition: function showPosition() {
var pre = this.pastInput();
var c = new Array(pre.length + 1).join('-');
return pre + this.upcomingInput() + '\n' + c + '^';
},
next: function next() {
if (this.done) {
return this.EOF;
}
if (!this._input) this.done = true;
var token, match, tempMatch, index, col, lines;
if (!this._more) {
this.yytext = '';
this.match = '';
}
var rules = this._currentRules();
for (var i = 0; i < rules.length; i++) {
tempMatch = this._input.match(this.rules[rules[i]]);
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
match = tempMatch;
index = i;
if (!this.options.flex) break;
}
}
if (match) {
lines = match[0].match(/\n.*/g);
if (lines) this.yylineno += lines.length;
this.yylloc = {
first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: lines
? lines[lines.length - 1].length - 1
: this.yylloc.last_column + match[0].length
};
this.yytext += match[0];
this.match += match[0];
this.yyleng = this.yytext.length;
this._more = false;
this._input = this._input.slice(match[0].length);
this.matched += match[0];
token = this.performAction.call(
this,
this.yy,
this,
rules[index],
this.conditionStack[this.conditionStack.length - 1]
);
if (this.done && this._input) this.done = false;
if (token) return token;
else return;
}
if (this._input === '') {
return this.EOF;
} else {
this.parseError(
'Lexical error on line ' +
(this.yylineno + 1) +
'. Unrecognized text.\n' +
this.showPosition(),
{
text: '',
token: null,
line: this.yylineno
}
);
}
},
lex: function lex() {
var r = this.next();
if (typeof r !== 'undefined') {
return r;
} else {
return this.lex();
}
},
begin: function begin(condition) {
this.conditionStack.push(condition);
},
popState: function popState() {
return this.conditionStack.pop();
},
_currentRules: function _currentRules() {
return this.conditions[
this.conditionStack[this.conditionStack.length - 1]
].rules;
},
topState: function topState() {
return this.conditionStack[this.conditionStack.length - 2];
},
pushState: function begin(condition) {
this.begin(condition);
}
};
lexer.options = {};
lexer.performAction = function anonymous(
yy,
yy_,
$avoiding_name_collisions,
YY_START
) {
var YYSTATE = YY_START;
switch ($avoiding_name_collisions) {
case 0:
/* skip whitespace */
break;
case 1:
return 6;
break;
case 2:
yy_.yytext = yy_.yytext.substr(1, yy_.yyleng - 2);
return 4;
break;
case 3:
return 17;
break;
case 4:
return 18;
break;
case 5:
return 23;
break;
case 6:
return 24;
break;
case 7:
return 22;
break;
case 8:
return 21;
break;
case 9:
return 10;
break;
case 10:
return 11;
break;
case 11:
return 8;
break;
case 12:
return 14;
break;
case 13:
return 'INVALID';
break;
}
};
lexer.rules = [
/^(?:\s+)/,
/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,
/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,
/^(?:\{)/,
/^(?:\})/,
/^(?:\[)/,
/^(?:\])/,
/^(?:,)/,
/^(?::)/,
/^(?:true\b)/,
/^(?:false\b)/,
/^(?:null\b)/,
/^(?:$)/,
/^(?:.)/
];
lexer.conditions = {
INITIAL: {
rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
inclusive: true
}
};
return lexer;
})();
parser.lexer = lexer;
return parser;
})();
exports.parser = jsonlint;
exports.errors = function(input) {
try {
this.parse(input);
} catch (e) {
return e.stack;
}
};
exports.parse = function() {
return jsonlint.parse.apply(jsonlint, arguments);
};
exports.main = function commonjsMain(args) {
if (!args[1]) throw new Error('Usage: ' + args[0] + ' FILE');
if (typeof process !== 'undefined') {
var source = require('fs').readFileSync(
require('path').join(process.cwd(), args[1]),
'utf8'
);
} else {
var cwd = require('file').path(require('file').cwd());
var source = cwd.join(args[1]).read({
charset: 'utf-8'
});
}
return exports.parser.parse(source);
};

75
node_modules/jest-config/package.json generated vendored Normal file
View file

@ -0,0 +1,75 @@
{
"_from": "jest-config@^24.8.0",
"_id": "jest-config@24.8.0",
"_inBundle": false,
"_integrity": "sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw==",
"_location": "/jest-config",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "jest-config@^24.8.0",
"name": "jest-config",
"escapedName": "jest-config",
"rawSpec": "^24.8.0",
"saveSpec": null,
"fetchSpec": "^24.8.0"
},
"_requiredBy": [
"/@jest/core",
"/jest-runner",
"/jest-runtime",
"/jest/jest-cli"
],
"_resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.8.0.tgz",
"_shasum": "77db3d265a6f726294687cbbccc36f8a76ee0f4f",
"_spec": "jest-config@^24.8.0",
"_where": "E:\\github\\setup-java\\node_modules\\jest\\node_modules\\jest-cli",
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"bundleDependencies": false,
"dependencies": {
"@babel/core": "^7.1.0",
"@jest/test-sequencer": "^24.8.0",
"@jest/types": "^24.8.0",
"babel-jest": "^24.8.0",
"chalk": "^2.0.1",
"glob": "^7.1.1",
"jest-environment-jsdom": "^24.8.0",
"jest-environment-node": "^24.8.0",
"jest-get-type": "^24.8.0",
"jest-jasmine2": "^24.8.0",
"jest-regex-util": "^24.3.0",
"jest-resolve": "^24.8.0",
"jest-util": "^24.8.0",
"jest-validate": "^24.8.0",
"micromatch": "^3.1.10",
"pretty-format": "^24.8.0",
"realpath-native": "^1.1.0"
},
"deprecated": false,
"devDependencies": {
"@types/babel__core": "^7.0.4",
"@types/glob": "^7.1.1",
"@types/micromatch": "^3.1.0"
},
"engines": {
"node": ">= 6"
},
"gitHead": "845728f24b3ef41e450595c384e9b5c9fdf248a4",
"homepage": "https://github.com/facebook/jest#readme",
"license": "MIT",
"main": "build/index.js",
"name": "jest-config",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/jest.git",
"directory": "packages/jest-config"
},
"types": "build/index.d.ts",
"version": "24.8.0"
}

20
node_modules/jest-config/tsconfig.json generated vendored Normal file
View file

@ -0,0 +1,20 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
},
// TODO: This is missing `jest-jasmine2`, but that is just
// `require.resolve`d, so no real use for its types
"references": [
{"path": "../jest-environment-jsdom"},
{"path": "../jest-environment-node"},
{"path": "../jest-get-type"},
{"path": "../jest-regex-util"},
{"path": "../jest-resolve"},
{"path": "../jest-types"},
{"path": "../jest-util"},
{"path": "../jest-validate"},
{"path": "../pretty-format"}
]
}

3323
node_modules/jest-config/tsconfig.tsbuildinfo generated vendored Normal file

File diff suppressed because it is too large Load diff