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

16
node_modules/@jest/core/build/FailedTestsCache.d.ts generated vendored Normal file
View file

@ -0,0 +1,16 @@
/**
* 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 { Test } from 'jest-runner';
import { Config } from '@jest/types';
import { TestResult } from '@jest/test-result';
export default class FailedTestsCache {
private _enabledTestsMap?;
filterTests(tests: Array<Test>): Array<Test>;
setTestResults(testResults: Array<TestResult>): void;
updateConfig(globalConfig: Config.GlobalConfig): Config.GlobalConfig;
}
//# sourceMappingURL=FailedTestsCache.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"FailedTestsCache.d.ts","sourceRoot":"","sources":["../src/FailedTestsCache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAI7C,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,OAAO,CAAC,gBAAgB,CAAC,CAAU;IAEnC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;IAS5C,cAAc,CAAC,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC;IAmB7C,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY;CAQrE"}

88
node_modules/@jest/core/build/FailedTestsCache.js generated vendored Normal file
View file

@ -0,0 +1,88 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
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.
*/
class FailedTestsCache {
constructor() {
_defineProperty(this, '_enabledTestsMap', void 0);
}
filterTests(tests) {
const enabledTestsMap = this._enabledTestsMap;
if (!enabledTestsMap) {
return tests;
}
return tests.filter(testResult => enabledTestsMap[testResult.path]);
}
setTestResults(testResults) {
this._enabledTestsMap = (testResults || [])
.filter(testResult => testResult.numFailingTests)
.reduce((suiteMap, testResult) => {
suiteMap[testResult.testFilePath] = testResult.testResults
.filter(test => test.status === 'failed')
.reduce((testMap, test) => {
testMap[test.fullName] = true;
return testMap;
}, {});
return suiteMap;
}, {});
this._enabledTestsMap = Object.freeze(this._enabledTestsMap);
}
updateConfig(globalConfig) {
if (!this._enabledTestsMap) {
return globalConfig;
}
const newConfig = _objectSpread({}, globalConfig);
newConfig.enabledTestsMap = this._enabledTestsMap;
return Object.freeze(newConfig);
}
}
exports.default = FailedTestsCache;

23
node_modules/@jest/core/build/ReporterDispatcher.d.ts generated vendored Normal file
View file

@ -0,0 +1,23 @@
/**
* 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 { AggregatedResult, TestResult } from '@jest/test-result';
import { Test } from 'jest-runner';
import { Context } from 'jest-runtime';
import { Reporter, ReporterOnStartOptions } from '@jest/reporters';
export default class ReporterDispatcher {
private _reporters;
constructor();
register(reporter: Reporter): void;
unregister(ReporterClass: Function): void;
onTestResult(test: Test, testResult: TestResult, results: AggregatedResult): Promise<void>;
onTestStart(test: Test): Promise<void>;
onRunStart(results: AggregatedResult, options: ReporterOnStartOptions): Promise<void>;
onRunComplete(contexts: Set<Context>, results: AggregatedResult): Promise<void>;
getErrors(): Array<Error>;
hasErrors(): boolean;
}
//# sourceMappingURL=ReporterDispatcher.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"ReporterDispatcher.d.ts","sourceRoot":"","sources":["../src/ReporterDispatcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,QAAQ,EAAE,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAEjE,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACrC,OAAO,CAAC,UAAU,CAAkB;;IAMpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAIlC,UAAU,CAAC,aAAa,EAAE,QAAQ;IAM5B,YAAY,CAChB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,gBAAgB;IAarB,WAAW,CAAC,IAAI,EAAE,IAAI;IAMtB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,sBAAsB;IAMrE,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB;IAQrE,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC;IAOzB,SAAS,IAAI,OAAO;CAGrB"}

231
node_modules/@jest/core/build/ReporterDispatcher.js generated vendored Normal file
View file

@ -0,0 +1,231 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
function _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.
*/
class ReporterDispatcher {
constructor() {
_defineProperty(this, '_reporters', void 0);
this._reporters = [];
}
register(reporter) {
this._reporters.push(reporter);
}
unregister(ReporterClass) {
this._reporters = this._reporters.filter(
reporter => !(reporter instanceof ReporterClass)
);
}
onTestResult(test, testResult, results) {
var _this = this;
return _asyncToGenerator(function*() {
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (
var _iterator = _this._reporters[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
_iteratorNormalCompletion = true
) {
const reporter = _step.value;
reporter.onTestResult &&
(yield reporter.onTestResult(test, testResult, results));
} // Release memory if unused later.
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
testResult.sourceMaps = undefined;
testResult.coverage = undefined;
testResult.console = undefined;
})();
}
onTestStart(test) {
var _this2 = this;
return _asyncToGenerator(function*() {
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (
var _iterator2 = _this2._reporters[Symbol.iterator](), _step2;
!(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done);
_iteratorNormalCompletion2 = true
) {
const reporter = _step2.value;
reporter.onTestStart && (yield reporter.onTestStart(test));
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
_iterator2.return();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
})();
}
onRunStart(results, options) {
var _this3 = this;
return _asyncToGenerator(function*() {
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (
var _iterator3 = _this3._reporters[Symbol.iterator](), _step3;
!(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done);
_iteratorNormalCompletion3 = true
) {
const reporter = _step3.value;
reporter.onRunStart && (yield reporter.onRunStart(results, options));
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
_iterator3.return();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
})();
}
onRunComplete(contexts, results) {
var _this4 = this;
return _asyncToGenerator(function*() {
var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;
try {
for (
var _iterator4 = _this4._reporters[Symbol.iterator](), _step4;
!(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done);
_iteratorNormalCompletion4 = true
) {
const reporter = _step4.value;
reporter.onRunComplete &&
(yield reporter.onRunComplete(contexts, results));
}
} catch (err) {
_didIteratorError4 = true;
_iteratorError4 = err;
} finally {
try {
if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
_iterator4.return();
}
} finally {
if (_didIteratorError4) {
throw _iteratorError4;
}
}
}
})();
} // Return a list of last errors for every reporter
getErrors() {
return this._reporters.reduce((list, reporter) => {
const error = reporter.getLastError && reporter.getLastError();
return error ? list.concat(error) : list;
}, []);
}
hasErrors() {
return this.getErrors().length !== 0;
}
}
exports.default = ReporterDispatcher;

43
node_modules/@jest/core/build/SearchSource.d.ts generated vendored Normal file
View file

@ -0,0 +1,43 @@
/**
* 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 { Context } from 'jest-runtime';
import { Config } from '@jest/types';
import { Test } from 'jest-runner';
import { ChangedFiles } from 'jest-changed-files';
import { Filter, Stats } from './types';
export declare type SearchResult = {
noSCM?: boolean;
stats?: Stats;
collectCoverageFrom?: Set<string>;
tests: Array<Test>;
total?: number;
};
export declare type TestSelectionConfig = {
input?: string;
findRelatedTests?: boolean;
onlyChanged?: boolean;
paths?: Array<Config.Path>;
shouldTreatInputAsPattern?: boolean;
testPathPattern?: string;
watch?: boolean;
};
export default class SearchSource {
private _context;
private _testPathCases;
constructor(context: Context);
private _filterTestPathsWithStats;
private _getAllTestPaths;
isTestFilePath(path: Config.Path): boolean;
findMatchingTests(testPathPattern?: string): SearchResult;
findRelatedTests(allPaths: Set<Config.Path>, collectCoverage: boolean): SearchResult;
findTestsByPaths(paths: Array<Config.Path>): SearchResult;
findRelatedTestsFromPattern(paths: Array<Config.Path>, collectCoverage: boolean): SearchResult;
findTestRelatedToChangedFiles(changedFilesInfo: ChangedFiles, collectCoverage: boolean): SearchResult;
private _getTestPaths;
getTestPaths(globalConfig: Config.GlobalConfig, changedFiles: ChangedFiles | undefined, filter?: Filter): Promise<SearchResult>;
}
//# sourceMappingURL=SearchSource.d.ts.map

1
node_modules/@jest/core/build/SearchSource.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"SearchSource.d.ts","sourceRoot":"","sources":["../src/SearchSource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAMhD,OAAO,EAAgB,MAAM,EAAE,KAAK,EAAC,MAAM,SAAS,CAAC;AAErD,oBAAY,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAeF,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,cAAc,CAAqB;gBAE/B,OAAO,EAAE,OAAO;IAqC5B,OAAO,CAAC,yBAAyB;IA4CjC,OAAO,CAAC,gBAAgB;IAOxB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO;IAI1C,iBAAiB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,YAAY;IAIzD,gBAAgB,CACd,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAC1B,eAAe,EAAE,OAAO,GACvB,YAAY;IA0Df,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY;IAWzD,2BAA2B,CACzB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EACzB,eAAe,EAAE,OAAO,GACvB,YAAY;IAUf,6BAA6B,CAC3B,gBAAgB,EAAE,YAAY,EAC9B,eAAe,EAAE,OAAO;IAY1B,OAAO,CAAC,aAAa;IA6Bf,YAAY,CAChB,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,YAAY,EAAE,YAAY,GAAG,SAAS,EACtC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,CAAC;CA4BzB"}

425
node_modules/@jest/core/build/SearchSource.js generated vendored Normal file
View file

@ -0,0 +1,425 @@
'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 _micromatch() {
const data = _interopRequireDefault(require('micromatch'));
_micromatch = function _micromatch() {
return data;
};
return data;
}
function _jestResolveDependencies() {
const data = _interopRequireDefault(require('jest-resolve-dependencies'));
_jestResolveDependencies = function _jestResolveDependencies() {
return data;
};
return data;
}
function _jestRegexUtil() {
const data = require('jest-regex-util');
_jestRegexUtil = function _jestRegexUtil() {
return data;
};
return data;
}
function _jestConfig() {
const data = require('jest-config');
_jestConfig = function _jestConfig() {
return data;
};
return data;
}
function _jestSnapshot() {
const data = require('jest-snapshot');
_jestSnapshot = function _jestSnapshot() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
function _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;
}
const globsToMatcher = globs => path =>
_micromatch().default.some(
(0, _jestUtil().replacePathSepForGlob)(path),
globs,
{
dot: true
}
);
const regexToMatcher = testRegex => path =>
testRegex.some(testRegex => new RegExp(testRegex).test(path));
const toTests = (context, tests) =>
tests.map(path => ({
context,
duration: undefined,
path
}));
class SearchSource {
constructor(context) {
_defineProperty(this, '_context', void 0);
_defineProperty(this, '_testPathCases', []);
const config = context.config;
this._context = context;
const rootPattern = new RegExp(
config.roots
.map(dir =>
(0, _jestRegexUtil().escapePathForRegex)(dir + _path().default.sep)
)
.join('|')
);
this._testPathCases.push({
isMatch: path => rootPattern.test(path),
stat: 'roots'
});
if (config.testMatch.length) {
this._testPathCases.push({
isMatch: globsToMatcher(config.testMatch),
stat: 'testMatch'
});
}
if (config.testPathIgnorePatterns.length) {
const testIgnorePatternsRegex = new RegExp(
config.testPathIgnorePatterns.join('|')
);
this._testPathCases.push({
isMatch: path => !testIgnorePatternsRegex.test(path),
stat: 'testPathIgnorePatterns'
});
}
if (config.testRegex.length) {
this._testPathCases.push({
isMatch: regexToMatcher(config.testRegex),
stat: 'testRegex'
});
}
}
_filterTestPathsWithStats(allPaths, testPathPattern) {
const data = {
stats: {
roots: 0,
testMatch: 0,
testPathIgnorePatterns: 0,
testRegex: 0
},
tests: [],
total: allPaths.length
};
const testCases = Array.from(this._testPathCases); // clone
if (testPathPattern) {
const regex = (0, _jestUtil().testPathPatternToRegExp)(testPathPattern);
testCases.push({
isMatch: path => regex.test(path),
stat: 'testPathPattern'
});
data.stats.testPathPattern = 0;
}
data.tests = allPaths.filter(test => {
let filterResult = true;
for (var _i = 0; _i < testCases.length; _i++) {
const _testCases$_i = testCases[_i],
isMatch = _testCases$_i.isMatch,
stat = _testCases$_i.stat;
if (isMatch(test.path)) {
data.stats[stat]++;
} else {
filterResult = false;
}
}
return filterResult;
});
return data;
}
_getAllTestPaths(testPathPattern) {
return this._filterTestPathsWithStats(
toTests(this._context, this._context.hasteFS.getAllFiles()),
testPathPattern
);
}
isTestFilePath(path) {
return this._testPathCases.every(testCase => testCase.isMatch(path));
}
findMatchingTests(testPathPattern) {
return this._getAllTestPaths(testPathPattern);
}
findRelatedTests(allPaths, collectCoverage) {
const dependencyResolver = new (_jestResolveDependencies()).default(
this._context.resolver,
this._context.hasteFS,
(0, _jestSnapshot().buildSnapshotResolver)(this._context.config)
);
if (!collectCoverage) {
return {
tests: toTests(
this._context,
dependencyResolver.resolveInverse(
allPaths,
this.isTestFilePath.bind(this),
{
skipNodeResolution: this._context.config.skipNodeResolution
}
)
)
};
}
const testModulesMap = dependencyResolver.resolveInverseModuleMap(
allPaths,
this.isTestFilePath.bind(this),
{
skipNodeResolution: this._context.config.skipNodeResolution
}
);
const allPathsAbsolute = Array.from(allPaths).map(p =>
_path().default.resolve(p)
);
const collectCoverageFrom = new Set();
testModulesMap.forEach(testModule => {
if (!testModule.dependencies) {
return;
}
testModule.dependencies
.filter(p => allPathsAbsolute.includes(p))
.map(filename => {
filename = (0, _jestConfig().replaceRootDirInPath)(
this._context.config.rootDir,
filename
);
return _path().default.isAbsolute(filename)
? _path().default.relative(this._context.config.rootDir, filename)
: filename;
})
.forEach(filename => collectCoverageFrom.add(filename));
});
return {
collectCoverageFrom,
tests: toTests(
this._context,
testModulesMap.map(testModule => testModule.file)
)
};
}
findTestsByPaths(paths) {
return {
tests: toTests(
this._context,
paths
.map(p => _path().default.resolve(this._context.config.cwd, p))
.filter(this.isTestFilePath.bind(this))
)
};
}
findRelatedTestsFromPattern(paths, collectCoverage) {
if (Array.isArray(paths) && paths.length) {
const resolvedPaths = paths.map(p =>
_path().default.resolve(this._context.config.cwd, p)
);
return this.findRelatedTests(new Set(resolvedPaths), collectCoverage);
}
return {
tests: []
};
}
findTestRelatedToChangedFiles(changedFilesInfo, collectCoverage) {
const repos = changedFilesInfo.repos,
changedFiles = changedFilesInfo.changedFiles; // no SCM (git/hg/...) is found in any of the roots.
const noSCM = Object.keys(repos).every(scm => repos[scm].size === 0);
return noSCM
? {
noSCM: true,
tests: []
}
: this.findRelatedTests(changedFiles, collectCoverage);
}
_getTestPaths(globalConfig, changedFiles) {
const paths = globalConfig.nonFlagArgs;
if (globalConfig.onlyChanged) {
if (!changedFiles) {
throw new Error('Changed files must be set when running with -o.');
}
return this.findTestRelatedToChangedFiles(
changedFiles,
globalConfig.collectCoverage
);
} else if (globalConfig.runTestsByPath && paths && paths.length) {
return this.findTestsByPaths(paths);
} else if (globalConfig.findRelatedTests && paths && paths.length) {
return this.findRelatedTestsFromPattern(
paths,
globalConfig.collectCoverage
);
} else if (globalConfig.testPathPattern != null) {
return this.findMatchingTests(globalConfig.testPathPattern);
} else {
return {
tests: []
};
}
}
getTestPaths(globalConfig, changedFiles, filter) {
var _this = this;
return _asyncToGenerator(function*() {
const searchResult = _this._getTestPaths(globalConfig, changedFiles);
const filterPath = globalConfig.filter;
if (filter) {
const tests = searchResult.tests;
const filterResult = yield filter(tests.map(test => test.path));
if (!Array.isArray(filterResult.filtered)) {
throw new Error(
`Filter ${filterPath} did not return a valid test list`
);
}
const filteredSet = new Set(
filterResult.filtered.map(result => result.test)
);
return _objectSpread({}, searchResult, {
tests: tests.filter(test => filteredSet.has(test.path))
});
}
return searchResult;
})();
}
}
exports.default = SearchSource;

View 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.
*/
/// <reference types="node" />
import { AggregatedResult, AssertionLocation } from '@jest/test-result';
export default class SnapshotInteractiveMode {
private _pipe;
private _isActive;
private _updateTestRunnerConfig;
private _testAssertions;
private _countPaths;
private _skippedNum;
constructor(pipe: NodeJS.WritableStream);
isActive(): boolean;
getSkippedNum(): number;
private _clearTestSummary;
private _drawUIProgress;
private _drawUIDoneWithSkipped;
private _drawUIDone;
private _drawUIOverlay;
put(key: string): void;
abort(): void;
restart(): void;
updateWithResults(results: AggregatedResult): void;
private _run;
run(failedSnapshotTestAssertions: Array<AssertionLocation>, onConfigChange: (assertion: AssertionLocation | null, shouldUpdateSnapshot: boolean) => unknown): void;
}
//# sourceMappingURL=SnapshotInteractiveMode.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"SnapshotInteractiveMode.d.ts","sourceRoot":"","sources":["../src/SnapshotInteractiveMode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAIH,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAMtE,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,uBAAuB,CAGlB;IACb,OAAO,CAAC,eAAe,CAA4B;IACnD,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,WAAW,CAAS;gBAEhB,IAAI,EAAE,MAAM,CAAC,cAAc;IAMvC,QAAQ;IAIR,aAAa;IAIb,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,eAAe;IA0CvB,OAAO,CAAC,sBAAsB;IAiC9B,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,cAAc;IAYtB,GAAG,CAAC,GAAG,EAAE,MAAM;IAqCf,KAAK;IAML,OAAO;IAMP,iBAAiB,CAAC,OAAO,EAAE,gBAAgB;IAiB3C,OAAO,CAAC,IAAI;IAKZ,GAAG,CACD,4BAA4B,EAAE,KAAK,CAAC,iBAAiB,CAAC,EACtD,cAAc,EAAE,CACd,SAAS,EAAE,iBAAiB,GAAG,IAAI,EACnC,oBAAoB,EAAE,OAAO,KAC1B,OAAO;CAYf"}

View file

@ -0,0 +1,328 @@
'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 _ansiEscapes() {
const data = _interopRequireDefault(require('ansi-escapes'));
_ansiEscapes = function _ansiEscapes() {
return data;
};
return data;
}
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
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;
}
const ARROW = _jestUtil().specialChars.ARROW,
CLEAR = _jestUtil().specialChars.CLEAR;
class SnapshotInteractiveMode {
constructor(pipe) {
_defineProperty(this, '_pipe', void 0);
_defineProperty(this, '_isActive', void 0);
_defineProperty(this, '_updateTestRunnerConfig', void 0);
_defineProperty(this, '_testAssertions', void 0);
_defineProperty(this, '_countPaths', void 0);
_defineProperty(this, '_skippedNum', void 0);
this._pipe = pipe;
this._isActive = false;
this._skippedNum = 0;
}
isActive() {
return this._isActive;
}
getSkippedNum() {
return this._skippedNum;
}
_clearTestSummary() {
this._pipe.write(_ansiEscapes().default.cursorUp(6));
this._pipe.write(_ansiEscapes().default.eraseDown);
}
_drawUIProgress() {
this._clearTestSummary();
const numPass = this._countPaths - this._testAssertions.length;
const numRemaining = this._countPaths - numPass - this._skippedNum;
let stats = _chalk().default.bold.dim(
(0, _jestUtil().pluralize)('snapshot', numRemaining) + ' remaining'
);
if (numPass) {
stats +=
', ' +
_chalk().default.bold.green(
(0, _jestUtil().pluralize)('snapshot', numPass) + ' updated'
);
}
if (this._skippedNum) {
stats +=
', ' +
_chalk().default.bold.yellow(
(0, _jestUtil().pluralize)('snapshot', this._skippedNum) + ' skipped'
);
}
const messages = [
'\n' + _chalk().default.bold('Interactive Snapshot Progress'),
ARROW + stats,
'\n' + _chalk().default.bold('Watch Usage'),
_chalk().default.dim(ARROW + 'Press ') +
'u' +
_chalk().default.dim(' to update failing snapshots for this test.'),
_chalk().default.dim(ARROW + 'Press ') +
's' +
_chalk().default.dim(' to skip the current test.'),
_chalk().default.dim(ARROW + 'Press ') +
'q' +
_chalk().default.dim(' to quit Interactive Snapshot Mode.'),
_chalk().default.dim(ARROW + 'Press ') +
'Enter' +
_chalk().default.dim(' to trigger a test run.')
];
this._pipe.write(messages.filter(Boolean).join('\n') + '\n');
}
_drawUIDoneWithSkipped() {
this._pipe.write(CLEAR);
const numPass = this._countPaths - this._testAssertions.length;
let stats = _chalk().default.bold.dim(
(0, _jestUtil().pluralize)('snapshot', this._countPaths) + ' reviewed'
);
if (numPass) {
stats +=
', ' +
_chalk().default.bold.green(
(0, _jestUtil().pluralize)('snapshot', numPass) + ' updated'
);
}
if (this._skippedNum) {
stats +=
', ' +
_chalk().default.bold.yellow(
(0, _jestUtil().pluralize)('snapshot', this._skippedNum) + ' skipped'
);
}
const messages = [
'\n' + _chalk().default.bold('Interactive Snapshot Result'),
ARROW + stats,
'\n' + _chalk().default.bold('Watch Usage'),
_chalk().default.dim(ARROW + 'Press ') +
'r' +
_chalk().default.dim(' to restart Interactive Snapshot Mode.'),
_chalk().default.dim(ARROW + 'Press ') +
'q' +
_chalk().default.dim(' to quit Interactive Snapshot Mode.')
];
this._pipe.write(messages.filter(Boolean).join('\n') + '\n');
}
_drawUIDone() {
this._pipe.write(CLEAR);
const numPass = this._countPaths - this._testAssertions.length;
let stats = _chalk().default.bold.dim(
(0, _jestUtil().pluralize)('snapshot', this._countPaths) + ' reviewed'
);
if (numPass) {
stats +=
', ' +
_chalk().default.bold.green(
(0, _jestUtil().pluralize)('snapshot', numPass) + ' updated'
);
}
const messages = [
'\n' + _chalk().default.bold('Interactive Snapshot Result'),
ARROW + stats,
'\n' + _chalk().default.bold('Watch Usage'),
_chalk().default.dim(ARROW + 'Press ') +
'Enter' +
_chalk().default.dim(' to return to watch mode.')
];
this._pipe.write(messages.filter(Boolean).join('\n') + '\n');
}
_drawUIOverlay() {
if (this._testAssertions.length === 0) {
return this._drawUIDone();
}
if (this._testAssertions.length - this._skippedNum === 0) {
return this._drawUIDoneWithSkipped();
}
return this._drawUIProgress();
}
put(key) {
switch (key) {
case 's':
if (this._skippedNum === this._testAssertions.length) break;
this._skippedNum += 1; // move skipped test to the end
this._testAssertions.push(this._testAssertions.shift());
if (this._testAssertions.length - this._skippedNum > 0) {
this._run(false);
} else {
this._drawUIDoneWithSkipped();
}
break;
case 'u':
this._run(true);
break;
case 'q':
case _jestWatcher().KEYS.ESCAPE:
this.abort();
break;
case 'r':
this.restart();
break;
case _jestWatcher().KEYS.ENTER:
if (this._testAssertions.length === 0) {
this.abort();
} else {
this._run(false);
}
break;
default:
break;
}
}
abort() {
this._isActive = false;
this._skippedNum = 0;
this._updateTestRunnerConfig(null, false);
}
restart() {
this._skippedNum = 0;
this._countPaths = this._testAssertions.length;
this._run(false);
}
updateWithResults(results) {
const hasSnapshotFailure = !!results.snapshot.failure;
if (hasSnapshotFailure) {
this._drawUIOverlay();
return;
}
this._testAssertions.shift();
if (this._testAssertions.length - this._skippedNum === 0) {
this._drawUIOverlay();
return;
} // Go to the next test
this._run(false);
}
_run(shouldUpdateSnapshot) {
const testAssertion = this._testAssertions[0];
this._updateTestRunnerConfig(testAssertion, shouldUpdateSnapshot);
}
run(failedSnapshotTestAssertions, onConfigChange) {
if (!failedSnapshotTestAssertions.length) {
return;
}
this._testAssertions = [...failedSnapshotTestAssertions];
this._countPaths = this._testAssertions.length;
this._updateTestRunnerConfig = onConfigChange;
this._isActive = true;
this._run(false);
}
}
exports.default = SnapshotInteractiveMode;

View file

@ -0,0 +1,18 @@
/**
* 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 { PatternPrompt, Prompt, ScrollOptions } from 'jest-watcher';
import { TestResult } from '@jest/test-result';
export default class TestNamePatternPrompt extends PatternPrompt {
_cachedTestResults: Array<TestResult>;
constructor(pipe: NodeJS.WritableStream, prompt: Prompt);
_onChange(pattern: string, options: ScrollOptions): void;
_printPrompt(pattern: string): void;
_getMatchedTests(pattern: string): string[];
updateCachedTestResults(testResults?: Array<TestResult>): void;
}
//# sourceMappingURL=TestNamePatternPrompt.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"TestNamePatternPrompt.d.ts","sourceRoot":"","sources":["../src/TestNamePatternPrompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EACL,aAAa,EACb,MAAM,EACN,aAAa,EAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAG7C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,aAAa;IAC9D,kBAAkB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;gBAE1B,IAAI,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM;IAMvD,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAKjD,YAAY,CAAC,OAAO,EAAE,MAAM;IAM5B,gBAAgB,CAAC,OAAO,EAAE,MAAM;IAsBhC,uBAAuB,CAAC,WAAW,GAAE,KAAK,CAAC,UAAU,CAAM;CAG5D"}

86
node_modules/@jest/core/build/TestNamePatternPrompt.js generated vendored Normal file
View file

@ -0,0 +1,86 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
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;
}
// TODO: Make underscored props `private`
class TestNamePatternPrompt extends _jestWatcher().PatternPrompt {
constructor(pipe, prompt) {
super(pipe, prompt);
_defineProperty(this, '_cachedTestResults', void 0);
this._entityName = 'tests';
this._cachedTestResults = [];
}
_onChange(pattern, options) {
super._onChange(pattern, options);
this._printPrompt(pattern);
}
_printPrompt(pattern) {
const pipe = this._pipe;
(0, _jestWatcher().printPatternCaret)(pattern, pipe);
(0, _jestWatcher().printRestoredPatternCaret)(
pattern,
this._currentUsageRows,
pipe
);
}
_getMatchedTests(pattern) {
let regex;
try {
regex = new RegExp(pattern, 'i');
} catch (e) {
return [];
}
const matchedTests = [];
this._cachedTestResults.forEach(({testResults}) =>
testResults.forEach(({title}) => {
if (regex.test(title)) {
matchedTests.push(title);
}
})
);
return matchedTests;
}
updateCachedTestResults(testResults = []) {
this._cachedTestResults = testResults;
}
}
exports.default = TestNamePatternPrompt;

View file

@ -0,0 +1,25 @@
/**
* 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 { Context } from 'jest-runtime';
import { Test } from 'jest-runner';
import { PatternPrompt, Prompt, ScrollOptions } from 'jest-watcher';
import SearchSource from './SearchSource';
declare type SearchSources = Array<{
context: Context;
searchSource: SearchSource;
}>;
export default class TestPathPatternPrompt extends PatternPrompt {
_searchSources?: SearchSources;
constructor(pipe: NodeJS.WritableStream, prompt: Prompt);
_onChange(pattern: string, options: ScrollOptions): void;
_printPrompt(pattern: string): void;
_getMatchedTests(pattern: string): Array<Test>;
updateSearchSources(searchSources: SearchSources): void;
}
export {};
//# sourceMappingURL=TestPathPatternPrompt.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"TestPathPatternPrompt.d.ts","sourceRoot":"","sources":["../src/TestPathPatternPrompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAEjC,OAAO,EACL,aAAa,EACb,MAAM,EACN,aAAa,EAGd,MAAM,cAAc,CAAC;AACtB,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,aAAK,aAAa,GAAG,KAAK,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC,CAAC;AAGH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,aAAa;IAC9D,cAAc,CAAC,EAAE,aAAa,CAAC;gBAEnB,IAAI,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM;IAKvD,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAKjD,YAAY,CAAC,OAAO,EAAE,MAAM;IAM5B,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC;IAiB9C,mBAAmB,CAAC,aAAa,EAAE,aAAa;CAGjD"}

81
node_modules/@jest/core/build/TestPathPatternPrompt.js generated vendored Normal file
View file

@ -0,0 +1,81 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
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;
}
// TODO: Make underscored props `private`
class TestPathPatternPrompt extends _jestWatcher().PatternPrompt {
constructor(pipe, prompt) {
super(pipe, prompt);
_defineProperty(this, '_searchSources', void 0);
this._entityName = 'filenames';
}
_onChange(pattern, options) {
super._onChange(pattern, options);
this._printPrompt(pattern);
}
_printPrompt(pattern) {
const pipe = this._pipe;
(0, _jestWatcher().printPatternCaret)(pattern, pipe);
(0, _jestWatcher().printRestoredPatternCaret)(
pattern,
this._currentUsageRows,
pipe
);
}
_getMatchedTests(pattern) {
let regex;
try {
regex = new RegExp(pattern, 'i');
} catch (e) {}
let tests = [];
if (regex && this._searchSources) {
this._searchSources.forEach(({searchSource}) => {
tests = tests.concat(searchSource.findMatchingTests(pattern).tests);
});
}
return tests;
}
updateSearchSources(searchSources) {
this._searchSources = searchSources;
}
}
exports.default = TestPathPatternPrompt;

41
node_modules/@jest/core/build/TestScheduler.d.ts generated vendored Normal file
View file

@ -0,0 +1,41 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Config } from '@jest/types';
import { Test } from 'jest-runner';
import { Reporter } from '@jest/reporters';
import { AggregatedResult } from '@jest/test-result';
import TestWatcher from './TestWatcher';
export declare type TestSchedulerOptions = {
startRun: (globalConfig: Config.GlobalConfig) => void;
};
export declare type TestSchedulerContext = {
firstRun: boolean;
previousSuccess: boolean;
changedFiles?: Set<Config.Path>;
};
export default class TestScheduler {
private _dispatcher;
private _globalConfig;
private _options;
private _context;
constructor(globalConfig: Config.GlobalConfig, options: TestSchedulerOptions, context: TestSchedulerContext);
addReporter(reporter: Reporter): void;
removeReporter(ReporterClass: Function): void;
scheduleTests(tests: Array<Test>, watcher: TestWatcher): Promise<AggregatedResult>;
private _partitionTests;
private _shouldAddDefaultReporters;
private _setupReporters;
private _setupDefaultReporters;
private _addCustomReporters;
/**
* Get properties of a reporter in an object
* to make dealing with them less painful.
*/
private _getReporterProps;
private _bailIfNeeded;
}
//# sourceMappingURL=TestScheduler.d.ts.map

1
node_modules/@jest/core/build/TestScheduler.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"TestScheduler.d.ts","sourceRoot":"","sources":["../src/TestScheduler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,OAAmB,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAE7C,OAAO,EAML,QAAQ,EACT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,gBAAgB,EAKjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,WAAW,MAAM,eAAe,CAAC;AAOxC,oBAAY,oBAAoB,GAAG;IACjC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,YAAY,KAAK,IAAI,CAAC;CACvD,CAAC;AACF,oBAAY,oBAAoB,GAAG;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC;AACF,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,QAAQ,CAAuB;gBAGrC,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,oBAAoB;IAS/B,WAAW,CAAC,QAAQ,EAAE,QAAQ;IAI9B,cAAc,CAAC,aAAa,EAAE,QAAQ;IAIhC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW;IAsJ5D,OAAO,CAAC,eAAe;IAuBvB,OAAO,CAAC,0BAA0B;IAWlC,OAAO,CAAC,eAAe;IA+BvB,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,mBAAmB;IAsB3B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,aAAa;CAsBtB"}

563
node_modules/@jest/core/build/TestScheduler.js generated vendored Normal file
View file

@ -0,0 +1,563 @@
'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 _jestMessageUtil() {
const data = require('jest-message-util');
_jestMessageUtil = function _jestMessageUtil() {
return data;
};
return data;
}
function _jestSnapshot() {
const data = _interopRequireDefault(require('jest-snapshot'));
_jestSnapshot = function _jestSnapshot() {
return data;
};
return data;
}
function _jestRunner() {
const data = _interopRequireDefault(require('jest-runner'));
_jestRunner = function _jestRunner() {
return data;
};
return data;
}
function _reporters() {
const data = require('@jest/reporters');
_reporters = function _reporters() {
return data;
};
return data;
}
function _exit() {
const data = _interopRequireDefault(require('exit'));
_exit = function _exit() {
return data;
};
return data;
}
function _testResult() {
const data = require('@jest/test-result');
_testResult = function _testResult() {
return data;
};
return data;
}
var _ReporterDispatcher = _interopRequireDefault(
require('./ReporterDispatcher')
);
var _testSchedulerHelper = require('./testSchedulerHelper');
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;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
function _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;
}
// The default jest-runner is required because it is the default test runner
// and required implicitly through the `runner` ProjectConfig option.
_jestRunner().default;
class TestScheduler {
constructor(globalConfig, options, context) {
_defineProperty(this, '_dispatcher', void 0);
_defineProperty(this, '_globalConfig', void 0);
_defineProperty(this, '_options', void 0);
_defineProperty(this, '_context', void 0);
this._dispatcher = new _ReporterDispatcher.default();
this._globalConfig = globalConfig;
this._options = options;
this._context = context;
this._setupReporters();
}
addReporter(reporter) {
this._dispatcher.register(reporter);
}
removeReporter(ReporterClass) {
this._dispatcher.unregister(ReporterClass);
}
scheduleTests(tests, watcher) {
var _this = this;
return _asyncToGenerator(function*() {
const onStart = _this._dispatcher.onTestStart.bind(_this._dispatcher);
const timings = [];
const contexts = new Set();
tests.forEach(test => {
contexts.add(test.context);
if (test.duration) {
timings.push(test.duration);
}
});
const aggregatedResults = createAggregatedResults(tests.length);
const estimatedTime = Math.ceil(
getEstimatedTime(timings, _this._globalConfig.maxWorkers) / 1000
);
const runInBand = (0, _testSchedulerHelper.shouldRunInBand)(
tests,
timings,
_this._globalConfig
);
const onResult =
/*#__PURE__*/
(function() {
var _ref = _asyncToGenerator(function*(test, testResult) {
if (watcher.isInterrupted()) {
return Promise.resolve();
}
if (testResult.testResults.length === 0) {
const message = 'Your test suite must contain at least one test.';
return onFailure(test, {
message,
stack: new Error(message).stack
});
} // Throws when the context is leaked after executing a test.
if (testResult.leaks) {
const message =
_chalk().default.red.bold('EXPERIMENTAL FEATURE!\n') +
'Your test suite is leaking memory. Please ensure all references are cleaned.\n' +
'\n' +
'There is a number of things that can leak memory:\n' +
' - Async operations that have not finished (e.g. fs.readFile).\n' +
' - Timers not properly mocked (e.g. setInterval, setTimeout).\n' +
' - Keeping references to the global scope.';
return onFailure(test, {
message,
stack: new Error(message).stack
});
}
(0, _testResult().addResult)(aggregatedResults, testResult);
yield _this._dispatcher.onTestResult(
test,
testResult,
aggregatedResults
);
return _this._bailIfNeeded(contexts, aggregatedResults, watcher);
});
return function onResult(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
const onFailure =
/*#__PURE__*/
(function() {
var _ref2 = _asyncToGenerator(function*(test, error) {
if (watcher.isInterrupted()) {
return;
}
const testResult = (0, _testResult().buildFailureTestResult)(
test.path,
error
);
testResult.failureMessage = (0, _jestMessageUtil().formatExecError)(
testResult.testExecError,
test.context.config,
_this._globalConfig,
test.path
);
(0, _testResult().addResult)(aggregatedResults, testResult);
yield _this._dispatcher.onTestResult(
test,
testResult,
aggregatedResults
);
});
return function onFailure(_x3, _x4) {
return _ref2.apply(this, arguments);
};
})();
const updateSnapshotState = () => {
contexts.forEach(context => {
const status = _jestSnapshot().default.cleanup(
context.hasteFS,
_this._globalConfig.updateSnapshot,
_jestSnapshot().default.buildSnapshotResolver(context.config),
context.config.testPathIgnorePatterns
);
aggregatedResults.snapshot.filesRemoved += status.filesRemoved;
aggregatedResults.snapshot.filesRemovedList = (
aggregatedResults.snapshot.filesRemovedList || []
).concat(status.filesRemovedList);
});
const updateAll = _this._globalConfig.updateSnapshot === 'all';
aggregatedResults.snapshot.didUpdate = updateAll;
aggregatedResults.snapshot.failure = !!(
!updateAll &&
(aggregatedResults.snapshot.unchecked ||
aggregatedResults.snapshot.unmatched ||
aggregatedResults.snapshot.filesRemoved)
);
};
yield _this._dispatcher.onRunStart(aggregatedResults, {
estimatedTime,
showStatus: !runInBand
});
const testRunners = Object.create(null);
contexts.forEach(({config}) => {
if (!testRunners[config.runner]) {
const Runner = require(config.runner);
testRunners[config.runner] = new Runner(_this._globalConfig, {
changedFiles: _this._context && _this._context.changedFiles
});
}
});
const testsByRunner = _this._partitionTests(testRunners, tests);
if (testsByRunner) {
try {
var _arr = Object.keys(testRunners);
for (var _i = 0; _i < _arr.length; _i++) {
const runner = _arr[_i];
yield testRunners[runner].runTests(
testsByRunner[runner],
watcher,
onStart,
onResult,
onFailure,
{
serial: runInBand || Boolean(testRunners[runner].isSerial)
}
);
}
} catch (error) {
if (!watcher.isInterrupted()) {
throw error;
}
}
}
updateSnapshotState();
aggregatedResults.wasInterrupted = watcher.isInterrupted();
yield _this._dispatcher.onRunComplete(contexts, aggregatedResults);
const anyTestFailures = !(
aggregatedResults.numFailedTests === 0 &&
aggregatedResults.numRuntimeErrorTestSuites === 0
);
const anyReporterErrors = _this._dispatcher.hasErrors();
aggregatedResults.success = !(
anyTestFailures ||
aggregatedResults.snapshot.failure ||
anyReporterErrors
);
return aggregatedResults;
})();
}
_partitionTests(testRunners, tests) {
if (Object.keys(testRunners).length > 1) {
return tests.reduce((testRuns, test) => {
const runner = test.context.config.runner;
if (!testRuns[runner]) {
testRuns[runner] = [];
}
testRuns[runner].push(test);
return testRuns;
}, Object.create(null));
} else if (tests.length > 0 && tests[0] != null) {
// If there is only one runner, don't partition the tests.
return Object.assign(Object.create(null), {
[tests[0].context.config.runner]: tests
});
} else {
return null;
}
}
_shouldAddDefaultReporters(reporters) {
return (
!reporters ||
!!reporters.find(
reporter => this._getReporterProps(reporter).path === 'default'
)
);
}
_setupReporters() {
const _this$_globalConfig = this._globalConfig,
collectCoverage = _this$_globalConfig.collectCoverage,
notify = _this$_globalConfig.notify,
reporters = _this$_globalConfig.reporters;
const isDefault = this._shouldAddDefaultReporters(reporters);
if (isDefault) {
this._setupDefaultReporters(collectCoverage);
}
if (!isDefault && collectCoverage) {
this.addReporter(
new (_reporters()).CoverageReporter(this._globalConfig, {
changedFiles: this._context && this._context.changedFiles
})
);
}
if (notify) {
this.addReporter(
new (_reporters()).NotifyReporter(
this._globalConfig,
this._options.startRun,
this._context
)
);
}
if (reporters && Array.isArray(reporters)) {
this._addCustomReporters(reporters);
}
}
_setupDefaultReporters(collectCoverage) {
this.addReporter(
this._globalConfig.verbose
? new (_reporters()).VerboseReporter(this._globalConfig)
: new (_reporters()).DefaultReporter(this._globalConfig)
);
if (collectCoverage) {
this.addReporter(
new (_reporters()).CoverageReporter(this._globalConfig, {
changedFiles: this._context && this._context.changedFiles
})
);
}
this.addReporter(new (_reporters()).SummaryReporter(this._globalConfig));
}
_addCustomReporters(reporters) {
reporters.forEach(reporter => {
const _this$_getReporterPro = this._getReporterProps(reporter),
options = _this$_getReporterPro.options,
path = _this$_getReporterPro.path;
if (path === 'default') return;
try {
const Reporter = require(path);
this.addReporter(new Reporter(this._globalConfig, options));
} catch (error) {
throw new Error(
'An error occurred while adding the reporter at path "' +
path +
'".' +
error.message
);
}
});
}
/**
* Get properties of a reporter in an object
* to make dealing with them less painful.
*/
_getReporterProps(reporter) {
if (typeof reporter === 'string') {
return {
options: this._options,
path: reporter
};
} else if (Array.isArray(reporter)) {
const _reporter = _slicedToArray(reporter, 2),
path = _reporter[0],
options = _reporter[1];
return {
options,
path
};
}
throw new Error('Reporter should be either a string or an array');
}
_bailIfNeeded(contexts, aggregatedResults, watcher) {
if (
this._globalConfig.bail !== 0 &&
aggregatedResults.numFailedTests >= this._globalConfig.bail
) {
if (watcher.isWatchMode()) {
watcher.setState({
interrupted: true
});
} else {
const failureExit = () => (0, _exit().default)(1);
return this._dispatcher
.onRunComplete(contexts, aggregatedResults)
.then(failureExit)
.catch(failureExit);
}
}
return Promise.resolve();
}
}
exports.default = TestScheduler;
const createAggregatedResults = numTotalTestSuites => {
const result = (0, _testResult().makeEmptyAggregatedTestResult)();
result.numTotalTestSuites = numTotalTestSuites;
result.startTime = Date.now();
result.success = false;
return result;
};
const getEstimatedTime = (timings, workers) => {
if (!timings.length) {
return 0;
}
const max = Math.max.apply(null, timings);
return timings.length <= workers
? max
: Math.max(timings.reduce((sum, time) => sum + time) / workers, max);
};

23
node_modules/@jest/core/build/TestWatcher.d.ts generated vendored Normal file
View file

@ -0,0 +1,23 @@
/**
* 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 { EventEmitter } from 'events';
declare type State = {
interrupted: boolean;
};
export default class TestWatcher extends EventEmitter {
state: State;
private _isWatchMode;
constructor({ isWatchMode }: {
isWatchMode: boolean;
});
setState(state: State): void;
isInterrupted(): boolean;
isWatchMode(): boolean;
}
export {};
//# sourceMappingURL=TestWatcher.d.ts.map

1
node_modules/@jest/core/build/TestWatcher.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"TestWatcher.d.ts","sourceRoot":"","sources":["../src/TestWatcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAEpC,aAAK,KAAK,GAAG;IACX,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,YAAY;IACnD,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,YAAY,CAAU;gBAElB,EAAC,WAAW,EAAC,EAAE;QAAC,WAAW,EAAE,OAAO,CAAA;KAAC;IAMjD,QAAQ,CAAC,KAAK,EAAE,KAAK;IAKrB,aAAa;IAIb,WAAW;CAGZ"}

60
node_modules/@jest/core/build/TestWatcher.js generated vendored Normal file
View file

@ -0,0 +1,60 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _events() {
const data = require('events');
_events = function _events() {
return data;
};
return data;
}
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;
}
class TestWatcher extends _events().EventEmitter {
constructor({isWatchMode}) {
super();
_defineProperty(this, 'state', void 0);
_defineProperty(this, '_isWatchMode', void 0);
this.state = {
interrupted: false
};
this._isWatchMode = isWatchMode;
}
setState(state) {
Object.assign(this.state, state);
this.emit('change', this.state);
}
isInterrupted() {
return this.state.interrupted;
}
isWatchMode() {
return this._isWatchMode;
}
}
exports.default = TestWatcher;

BIN
node_modules/@jest/core/build/assets/jest_logo.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

100
node_modules/@jest/core/build/cli/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,100 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/// <reference types="yargs" />
import { Config } from '@jest/types';
import { AggregatedResult } from '@jest/test-result';
export declare const runCLI: (argv: import("yargs").Arguments<Partial<{
all: boolean;
automock: boolean;
bail: number | boolean;
browser: boolean;
cache: boolean;
cacheDirectory: string;
changedFilesWithAncestor: boolean;
changedSince: string;
ci: boolean;
clearCache: boolean;
clearMocks: boolean;
collectCoverage: boolean;
collectCoverageFrom: string;
collectCoverageOnlyFrom: string[];
color: boolean;
colors: boolean;
config: string;
coverage: boolean;
coverageDirectory: string;
coveragePathIgnorePatterns: string[];
coverageReporters: string[];
coverageThreshold: string;
debug: boolean;
env: string;
expand: boolean;
findRelatedTests: boolean;
forceExit: boolean;
globals: string;
globalSetup: string | null | undefined;
globalTeardown: string | null | undefined;
haste: string;
init: boolean;
json: boolean;
lastCommit: boolean;
logHeapUsage: boolean;
maxWorkers: string | number;
moduleDirectories: string[];
moduleFileExtensions: string[];
moduleNameMapper: string;
modulePathIgnorePatterns: string[];
modulePaths: string[];
noStackTrace: boolean;
notify: boolean;
notifyMode: string;
onlyChanged: boolean;
outputFile: string;
preset: string | null | undefined;
projects: string[];
prettierPath: string | null | undefined;
resetMocks: boolean;
resetModules: boolean;
resolver: string | null | undefined;
restoreMocks: boolean;
rootDir: string;
roots: string[];
runInBand: boolean;
setupFiles: string[];
setupFilesAfterEnv: string[];
showConfig: boolean;
silent: boolean;
snapshotSerializers: string[];
testEnvironment: string;
testFailureExitCode: string | null | undefined;
testMatch: string[];
testNamePattern: string;
testPathIgnorePatterns: string[];
testPathPattern: string[];
testRegex: string | string[];
testResultsProcessor: string | null | undefined;
testRunner: string;
testSequencer: string;
testURL: string;
testTimeout: number | null | undefined;
timers: string;
transform: string;
transformIgnorePatterns: string[];
unmockedModulePathPatterns: string[] | null | undefined;
updateSnapshot: boolean;
useStderr: boolean;
verbose: boolean | null | undefined;
version: boolean;
watch: boolean;
watchAll: boolean;
watchman: boolean;
watchPathIgnorePatterns: string[];
}>>, projects: string[]) => Promise<{
results: AggregatedResult;
globalConfig: Config.GlobalConfig;
}>;
//# sourceMappingURL=index.d.ts.map

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

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAyBnD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8ElB,CAAC"}

471
node_modules/@jest/core/build/cli/index.js generated vendored Normal file
View file

@ -0,0 +1,471 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.runCLI = void 0;
function _console() {
const data = require('@jest/console');
_console = function _console() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
return data;
};
return data;
}
function _jestConfig() {
const data = require('jest-config');
_jestConfig = function _jestConfig() {
return data;
};
return data;
}
function _jestRuntime() {
const data = _interopRequireDefault(require('jest-runtime'));
_jestRuntime = function _jestRuntime() {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
function _rimraf() {
const data = _interopRequireDefault(require('rimraf'));
_rimraf = function _rimraf() {
return data;
};
return data;
}
function _exit() {
const data = _interopRequireDefault(require('exit'));
_exit = function _exit() {
return data;
};
return data;
}
var _create_context = _interopRequireDefault(require('../lib/create_context'));
var _getChangedFilesPromise = _interopRequireDefault(
require('../getChangedFilesPromise')
);
var _collectHandles = require('../collectHandles');
var _handle_deprecation_warnings = _interopRequireDefault(
require('../lib/handle_deprecation_warnings')
);
var _runJest = _interopRequireDefault(require('../runJest'));
var _TestWatcher = _interopRequireDefault(require('../TestWatcher'));
var _watch = _interopRequireDefault(require('../watch'));
var _pluralize = _interopRequireDefault(require('../pluralize'));
var _log_debug_messages = _interopRequireDefault(
require('../lib/log_debug_messages')
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
const preRunMessagePrint = _jestUtil().preRunMessage.print;
const runCLI =
/*#__PURE__*/
(function() {
var _ref = _asyncToGenerator(function*(argv, projects) {
const realFs = require('fs');
const fs = require('graceful-fs');
fs.gracefulify(realFs);
let results; // If we output a JSON object, we can't write anything to stdout, since
// it'll break the JSON structure and it won't be valid.
const outputStream =
argv.json || argv.useStderr ? process.stderr : process.stdout;
const _readConfigs = (0, _jestConfig().readConfigs)(argv, projects),
globalConfig = _readConfigs.globalConfig,
configs = _readConfigs.configs,
hasDeprecationWarnings = _readConfigs.hasDeprecationWarnings;
if (argv.debug) {
(0, _log_debug_messages.default)(globalConfig, configs, outputStream);
}
if (argv.showConfig) {
(0, _log_debug_messages.default)(globalConfig, configs, process.stdout);
(0, _exit().default)(0);
}
if (argv.clearCache) {
configs.forEach(config => {
_rimraf().default.sync(config.cacheDirectory);
process.stdout.write(`Cleared ${config.cacheDirectory}\n`);
});
(0, _exit().default)(0);
}
yield _run(
globalConfig,
configs,
hasDeprecationWarnings,
outputStream,
r => (results = r)
);
if (argv.watch || argv.watchAll) {
// If in watch mode, return the promise that will never resolve.
// If the watch mode is interrupted, watch should handle the process
// shutdown.
return new Promise(() => {});
}
if (!results) {
throw new Error(
'AggregatedResult must be present after test run is complete'
);
}
const _results = results,
openHandles = _results.openHandles;
if (openHandles && openHandles.length) {
const formatted = (0, _collectHandles.formatHandleErrors)(
openHandles,
configs[0]
);
const openHandlesString = (0, _pluralize.default)(
'open handle',
formatted.length,
's'
);
const message =
_chalk().default.red(
`\nJest has detected the following ${openHandlesString} potentially keeping Jest from exiting:\n\n`
) + formatted.join('\n\n');
console.error(message);
}
return {
globalConfig,
results
};
});
return function runCLI(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
exports.runCLI = runCLI;
const buildContextsAndHasteMaps =
/*#__PURE__*/
(function() {
var _ref2 = _asyncToGenerator(function*(
configs,
globalConfig,
outputStream
) {
const hasteMapInstances = Array(configs.length);
const contexts = yield Promise.all(
configs.map(
/*#__PURE__*/
(function() {
var _ref3 = _asyncToGenerator(function*(config, index) {
(0, _jestUtil().createDirectory)(config.cacheDirectory);
const hasteMapInstance = _jestRuntime().default.createHasteMap(
config,
{
console: new (_console()).CustomConsole(
outputStream,
outputStream
),
maxWorkers: globalConfig.maxWorkers,
resetCache: !config.cache,
watch: globalConfig.watch || globalConfig.watchAll,
watchman: globalConfig.watchman
}
);
hasteMapInstances[index] = hasteMapInstance;
return (0,
_create_context.default)(config, yield hasteMapInstance.build());
});
return function(_x6, _x7) {
return _ref3.apply(this, arguments);
};
})()
)
);
return {
contexts,
hasteMapInstances
};
});
return function buildContextsAndHasteMaps(_x3, _x4, _x5) {
return _ref2.apply(this, arguments);
};
})();
const _run =
/*#__PURE__*/
(function() {
var _ref4 = _asyncToGenerator(function*(
globalConfig,
configs,
hasDeprecationWarnings,
outputStream,
onComplete
) {
// Queries to hg/git can take a while, so we need to start the process
// as soon as possible, so by the time we need the result it's already there.
const changedFilesPromise = (0, _getChangedFilesPromise.default)(
globalConfig,
configs
); // Filter may need to do an HTTP call or something similar to setup.
// We will wait on an async response from this before using the filter.
let filter;
if (globalConfig.filter && !globalConfig.skipFilter) {
const rawFilter = require(globalConfig.filter);
let filterSetupPromise;
if (rawFilter.setup) {
// Wrap filter setup Promise to avoid "uncaught Promise" error.
// If an error is returned, we surface it in the return value.
filterSetupPromise = _asyncToGenerator(function*() {
try {
yield rawFilter.setup();
} catch (err) {
return err;
}
return undefined;
})();
}
filter =
/*#__PURE__*/
(function() {
var _ref6 = _asyncToGenerator(function*(testPaths) {
if (filterSetupPromise) {
// Expect an undefined return value unless there was an error.
const err = yield filterSetupPromise;
if (err) {
throw err;
}
}
return rawFilter(testPaths);
});
return function filter(_x13) {
return _ref6.apply(this, arguments);
};
})();
}
const _ref7 = yield buildContextsAndHasteMaps(
configs,
globalConfig,
outputStream
),
contexts = _ref7.contexts,
hasteMapInstances = _ref7.hasteMapInstances;
globalConfig.watch || globalConfig.watchAll
? yield runWatch(
contexts,
configs,
hasDeprecationWarnings,
globalConfig,
outputStream,
hasteMapInstances,
filter
)
: yield runWithoutWatch(
globalConfig,
contexts,
outputStream,
onComplete,
changedFilesPromise,
filter
);
});
return function _run(_x8, _x9, _x10, _x11, _x12) {
return _ref4.apply(this, arguments);
};
})();
const runWatch =
/*#__PURE__*/
(function() {
var _ref8 = _asyncToGenerator(function*(
contexts,
_configs,
hasDeprecationWarnings,
globalConfig,
outputStream,
hasteMapInstances,
filter
) {
if (hasDeprecationWarnings) {
try {
yield (0, _handle_deprecation_warnings.default)(
outputStream,
process.stdin
);
return (0, _watch.default)(
globalConfig,
contexts,
outputStream,
hasteMapInstances,
undefined,
undefined,
filter
);
} catch (e) {
(0, _exit().default)(0);
}
}
return (0, _watch.default)(
globalConfig,
contexts,
outputStream,
hasteMapInstances,
undefined,
undefined,
filter
);
});
return function runWatch(_x14, _x15, _x16, _x17, _x18, _x19, _x20) {
return _ref8.apply(this, arguments);
};
})();
const runWithoutWatch =
/*#__PURE__*/
(function() {
var _ref9 = _asyncToGenerator(function*(
globalConfig,
contexts,
outputStream,
onComplete,
changedFilesPromise,
filter
) {
const startRun =
/*#__PURE__*/
(function() {
var _ref10 = _asyncToGenerator(function*() {
if (!globalConfig.listTests) {
preRunMessagePrint(outputStream);
}
return (0, _runJest.default)({
changedFilesPromise,
contexts,
failedTestsCache: undefined,
filter,
globalConfig,
onComplete,
outputStream,
startRun,
testWatcher: new _TestWatcher.default({
isWatchMode: false
})
});
});
return function startRun() {
return _ref10.apply(this, arguments);
};
})();
return startRun();
});
return function runWithoutWatch(_x21, _x22, _x23, _x24, _x25, _x26) {
return _ref9.apply(this, arguments);
};
})();

10
node_modules/@jest/core/build/collectHandles.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';
export default function collectHandles(): () => Array<Error>;
export declare function formatHandleErrors(errors: Array<Error>, config: Config.ProjectConfig): Array<string>;
//# sourceMappingURL=collectHandles.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"collectHandles.d.ts","sourceRoot":"","sources":["../src/collectHandles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AA+BnC,MAAM,CAAC,OAAO,UAAU,cAAc,IAAI,MAAM,KAAK,CAAC,KAAK,CAAC,CA0C3D;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EACpB,MAAM,EAAE,MAAM,CAAC,aAAa,GAC3B,KAAK,CAAC,MAAM,CAAC,CA8Bf"}

149
node_modules/@jest/core/build/collectHandles.js generated vendored Normal file
View file

@ -0,0 +1,149 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = collectHandles;
exports.formatHandleErrors = formatHandleErrors;
function _jestMessageUtil() {
const data = require('jest-message-util');
_jestMessageUtil = function _jestMessageUtil() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
return data;
};
return data;
}
function _stripAnsi() {
const data = _interopRequireDefault(require('strip-ansi'));
_stripAnsi = function _stripAnsi() {
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 stackIsFromUser(stack) {
// Either the test file, or something required by it
if (stack.includes('Runtime.requireModule')) {
return true;
} // jest-jasmine it or describe call
if (stack.includes('asyncJestTest') || stack.includes('asyncJestLifecycle')) {
return true;
} // An async function call from within circus
if (stack.includes('callAsyncCircusFn')) {
// jest-circus it or describe call
return (
stack.includes('_callCircusTest') || stack.includes('_callCircusHook')
);
}
return false;
} // Inspired by https://github.com/mafintosh/why-is-node-running/blob/master/index.js
// Extracted as we want to format the result ourselves
function collectHandles() {
const activeHandles = new Map();
let hook;
try {
const asyncHooks = require('async_hooks');
hook = asyncHooks.createHook({
destroy(asyncId) {
activeHandles.delete(asyncId);
},
init: function initHook(asyncId, type) {
if (type === 'PROMISE' || type === 'TIMERWRAP') {
return;
}
const error = new (_jestUtil()).ErrorWithStack(type, initHook);
if (stackIsFromUser(error.stack || '')) {
activeHandles.set(asyncId, error);
}
}
});
hook.enable();
} catch (e) {
const nodeMajor = Number(process.versions.node.split('.')[0]);
if (e.code === 'MODULE_NOT_FOUND' && nodeMajor < 8) {
throw new Error(
'You can only use --detectOpenHandles on Node 8 and newer.'
);
} else {
throw e;
}
}
return () => {
hook.disable();
const result = Array.from(activeHandles.values());
activeHandles.clear();
return result;
};
}
function formatHandleErrors(errors, config) {
const stacks = new Set();
return (
errors
.map(err =>
(0, _jestMessageUtil().formatExecError)(
err,
config,
{
noStackTrace: false
},
undefined,
true
)
) // E.g. timeouts might give multiple traces to the same line of code
// This hairy filtering tries to remove entries with duplicate stack traces
.filter(handle => {
const ansiFree = (0, _stripAnsi().default)(handle);
const match = ansiFree.match(/\s+at(.*)/);
if (!match || match.length < 2) {
return true;
}
const stack = ansiFree.substr(ansiFree.indexOf(match[1])).trim();
if (stacks.has(stack)) {
return false;
}
stacks.add(stack);
return true;
})
);
}

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: (globalConfig: Config.GlobalConfig, configs: Config.ProjectConfig[]) => Promise<import("jest-changed-files").ChangedFiles> | undefined;
export default _default;
//# sourceMappingURL=getChangedFilesPromise.d.ts.map

View file

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

View file

@ -0,0 +1,78 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestChangedFiles() {
const data = require('jest-changed-files');
_jestChangedFiles = function _jestChangedFiles() {
return data;
};
return data;
}
function _jestMessageUtil() {
const data = require('jest-message-util');
_jestMessageUtil = function _jestMessageUtil() {
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.
*/
var _default = (globalConfig, configs) => {
if (globalConfig.onlyChanged) {
const allRootsForAllProjects = configs.reduce(
(roots, config) => [...roots, ...(config.roots || [])],
[]
);
return (0, _jestChangedFiles().getChangedFilesForRoots)(
allRootsForAllProjects,
{
changedSince: globalConfig.changedSince,
lastCommit: globalConfig.lastCommit,
withAncestor: globalConfig.changedFilesWithAncestor
}
).catch(e => {
const message = (0, _jestMessageUtil().formatExecError)(e, configs[0], {
noStackTrace: true
})
.split('\n')
.filter(line => !line.includes('Command failed:'))
.join('\n');
console.error(_chalk().default.red(`\n\n${message}`));
process.exit(1); // We do process.exit, so this is dead code
return Promise.reject(e);
});
}
return undefined;
};
exports.default = _default;

10
node_modules/@jest/core/build/getNoTestFound.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';
import { TestRunData } from './types';
export default function getNoTestFound(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string;
//# sourceMappingURL=getNoTestFound.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getNoTestFound.d.ts","sourceRoot":"","sources":["../src/getNoTestFound.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAGpC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,MAAM,CAAC,YAAY,GAChC,MAAM,CAgCR"}

63
node_modules/@jest/core/build/getNoTestFound.js generated vendored Normal file
View file

@ -0,0 +1,63 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = getNoTestFound;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
var _pluralize = _interopRequireDefault(require('./pluralize'));
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 getNoTestFound(testRunData, globalConfig) {
const testFiles = testRunData.reduce(
(current, testRun) => current + (testRun.matches.total || 0),
0
);
let dataMessage;
if (globalConfig.runTestsByPath) {
dataMessage = `Files: ${globalConfig.nonFlagArgs
.map(p => `"${p}"`)
.join(', ')}`;
} else {
dataMessage = `Pattern: ${_chalk().default.yellow(
globalConfig.testPathPattern
)} - 0 matches`;
}
return (
_chalk().default.bold('No tests found, exiting with code 1') +
'\n' +
'Run with `--passWithNoTests` to exit with code 0' +
'\n' +
`In ${_chalk().default.bold(globalConfig.rootDir)}` +
'\n' +
` ${(0, _pluralize.default)('file', testFiles, 's')} checked across ${(0,
_pluralize.default)(
'project',
testRunData.length,
's'
)}. Run with \`--verbose\` for more details.` +
'\n' +
dataMessage
);
}

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 getNoTestFoundFailed(): string;
//# sourceMappingURL=getNoTestFoundFailed.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getNoTestFoundFailed.d.ts","sourceRoot":"","sources":["../src/getNoTestFoundFailed.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,OAAO,UAAU,oBAAoB,WAK3C"}

33
node_modules/@jest/core/build/getNoTestFoundFailed.js generated vendored Normal file
View file

@ -0,0 +1,33 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = getNoTestFoundFailed;
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.
*/
function getNoTestFoundFailed() {
return (
_chalk().default.bold('No failed test found.\n') +
_chalk().default.dim('Press `f` to quit "only failed tests" mode.')
);
}

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 getNoTestFoundPassWithNoTests(): string;
//# sourceMappingURL=getNoTestFoundPassWithNoTests.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getNoTestFoundPassWithNoTests.d.ts","sourceRoot":"","sources":["../src/getNoTestFoundPassWithNoTests.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,OAAO,UAAU,6BAA6B,WAEpD"}

View file

@ -0,0 +1,30 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = getNoTestFoundPassWithNoTests;
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.
*/
function getNoTestFoundPassWithNoTests() {
return _chalk().default.bold('No tests found, exiting with code 0');
}

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 getNoTestFoundRelatedToChangedFiles(globalConfig: Config.GlobalConfig): string;
//# sourceMappingURL=getNoTestFoundRelatedToChangedFiles.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getNoTestFoundRelatedToChangedFiles.d.ts","sourceRoot":"","sources":["../src/getNoTestFoundRelatedToChangedFiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGnC,MAAM,CAAC,OAAO,UAAU,mCAAmC,CACzD,YAAY,EAAE,MAAM,CAAC,YAAY,UAiBlC"}

View file

@ -0,0 +1,57 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = getNoTestFoundRelatedToChangedFiles;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
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 getNoTestFoundRelatedToChangedFiles(globalConfig) {
const ref = globalConfig.changedSince
? `"${globalConfig.changedSince}"`
: 'last commit';
let msg = _chalk().default.bold(
`No tests found related to files changed since ${ref}.`
);
if (_jestUtil().isInteractive) {
msg += _chalk().default.dim(
'\n' +
(globalConfig.watch
? 'Press `a` to run all tests, or run Jest with `--watchAll`.'
: 'Run Jest without `-o` or with `--all` to run all tests.')
);
}
return msg;
}

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';
import { TestRunData } from './types';
export default function getNoTestFoundVerbose(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string;
//# sourceMappingURL=getNoTestFoundVerbose.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getNoTestFoundVerbose.d.ts","sourceRoot":"","sources":["../src/getNoTestFoundVerbose.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAQ,WAAW,EAAC,MAAM,SAAS,CAAC;AAE3C,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,MAAM,CAAC,YAAY,GAChC,MAAM,CAqDR"}

95
node_modules/@jest/core/build/getNoTestFoundVerbose.js generated vendored Normal file
View file

@ -0,0 +1,95 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = getNoTestFoundVerbose;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
var _pluralize = _interopRequireDefault(require('./pluralize'));
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 getNoTestFoundVerbose(testRunData, globalConfig) {
const individualResults = testRunData.map(testRun => {
const stats = testRun.matches.stats || {};
const config = testRun.context.config;
const statsMessage = Object.keys(stats)
.map(key => {
if (key === 'roots' && config.roots.length === 1) {
return null;
}
const value = config[key];
if (value) {
const valueAsString = Array.isArray(value)
? value.join(', ')
: String(value);
const matches = (0, _pluralize.default)(
'match',
stats[key] || 0,
'es'
);
return ` ${key}: ${_chalk().default.yellow(
valueAsString
)} - ${matches}`;
}
return null;
})
.filter(line => line)
.join('\n');
return testRun.matches.total
? `In ${_chalk().default.bold(config.rootDir)}\n` +
` ${(0, _pluralize.default)(
'file',
testRun.matches.total || 0,
's'
)} checked.\n` +
statsMessage
: `No files found in ${config.rootDir}.\n` +
`Make sure Jest's configuration does not exclude this directory.` +
`\nTo set up Jest, make sure a package.json file exists.\n` +
`Jest Documentation: ` +
`facebook.github.io/jest/docs/configuration.html`;
});
let dataMessage;
if (globalConfig.runTestsByPath) {
dataMessage = `Files: ${globalConfig.nonFlagArgs
.map(p => `"${p}"`)
.join(', ')}`;
} else {
dataMessage = `Pattern: ${_chalk().default.yellow(
globalConfig.testPathPattern
)} - 0 matches`;
}
return (
_chalk().default.bold('No tests found, exiting with code 1') +
'\n' +
'Run with `--passWithNoTests` to exit with code 0' +
'\n' +
individualResults.join('\n') +
'\n' +
dataMessage
);
}

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';
import { TestRunData } from './types';
export default function getNoTestsFoundMessage(testRunData: TestRunData, globalConfig: Config.GlobalConfig): string;
//# sourceMappingURL=getNoTestsFoundMessage.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getNoTestsFoundMessage.d.ts","sourceRoot":"","sources":["../src/getNoTestsFoundMessage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAOpC,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,MAAM,CAAC,YAAY,GAChC,MAAM,CAaR"}

View file

@ -0,0 +1,52 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = getNoTestsFoundMessage;
var _getNoTestFound = _interopRequireDefault(require('./getNoTestFound'));
var _getNoTestFoundRelatedToChangedFiles = _interopRequireDefault(
require('./getNoTestFoundRelatedToChangedFiles')
);
var _getNoTestFoundVerbose = _interopRequireDefault(
require('./getNoTestFoundVerbose')
);
var _getNoTestFoundFailed = _interopRequireDefault(
require('./getNoTestFoundFailed')
);
var _getNoTestFoundPassWithNoTests = _interopRequireDefault(
require('./getNoTestFoundPassWithNoTests')
);
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 getNoTestsFoundMessage(testRunData, globalConfig) {
if (globalConfig.onlyFailures) {
return (0, _getNoTestFoundFailed.default)();
}
if (globalConfig.onlyChanged) {
return (0, _getNoTestFoundRelatedToChangedFiles.default)(globalConfig);
}
if (globalConfig.passWithNoTests) {
return (0, _getNoTestFoundPassWithNoTests.default)();
}
return testRunData.length === 1 || globalConfig.verbose
? (0, _getNoTestFoundVerbose.default)(testRunData, globalConfig)
: (0, _getNoTestFound.default)(testRunData, globalConfig);
}

12
node_modules/@jest/core/build/jest.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 { default as SearchSource } from './SearchSource';
export { default as TestScheduler } from './TestScheduler';
export { default as TestWatcher } from './TestWatcher';
export { runCLI } from './cli';
export { default as getVersion } from './version';
//# sourceMappingURL=jest.d.ts.map

1
node_modules/@jest/core/build/jest.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"jest.d.ts","sourceRoot":"","sources":["../src/jest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,MAAM,EAAC,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,WAAW,CAAC"}

49
node_modules/@jest/core/build/jest.js generated vendored Normal file
View file

@ -0,0 +1,49 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
Object.defineProperty(exports, 'SearchSource', {
enumerable: true,
get: function get() {
return _SearchSource.default;
}
});
Object.defineProperty(exports, 'TestScheduler', {
enumerable: true,
get: function get() {
return _TestScheduler.default;
}
});
Object.defineProperty(exports, 'TestWatcher', {
enumerable: true,
get: function get() {
return _TestWatcher.default;
}
});
Object.defineProperty(exports, 'runCLI', {
enumerable: true,
get: function get() {
return _cli.runCLI;
}
});
Object.defineProperty(exports, 'getVersion', {
enumerable: true,
get: function get() {
return _version.default;
}
});
var _SearchSource = _interopRequireDefault(require('./SearchSource'));
var _TestScheduler = _interopRequireDefault(require('./TestScheduler'));
var _TestWatcher = _interopRequireDefault(require('./TestWatcher'));
var _cli = require('./cli');
var _version = _interopRequireDefault(require('./version'));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}

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 activeFilters: (globalConfig: Config.GlobalConfig, delimiter?: string) => string;
export default activeFilters;
//# sourceMappingURL=active_filters_message.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"active_filters_message.d.ts","sourceRoot":"","sources":["../../src/lib/active_filters_message.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,QAAA,MAAM,aAAa,mEAuBlB,CAAC;AAEF,eAAe,aAAa,CAAC"}

View file

@ -0,0 +1,55 @@
'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 _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 activeFilters = (globalConfig, delimiter = '\n') => {
const testNamePattern = globalConfig.testNamePattern,
testPathPattern = globalConfig.testPathPattern;
if (testNamePattern || testPathPattern) {
const filters = [
testPathPattern
? _chalk().default.dim('filename ') +
_chalk().default.yellow('/' + testPathPattern + '/')
: null,
testNamePattern
? _chalk().default.dim('test name ') +
_chalk().default.yellow('/' + testNamePattern + '/')
: null
]
.filter(f => f)
.join(', ');
const messages = [
'\n' + _chalk().default.bold('Active Filters: ') + filters
];
return messages.filter(message => !!message).join(delimiter);
}
return '';
};
var _default = activeFilters;
exports.default = _default;

10
node_modules/@jest/core/build/lib/create_context.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 _default: (config: Config.ProjectConfig, { hasteFS, moduleMap }: import("jest-haste-map/build/types").HasteMap) => import("jest-runtime/build/types").Context;
export default _default;
//# sourceMappingURL=create_context.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"create_context.d.ts","sourceRoot":"","sources":["../../src/lib/create_context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;;AAInC,wBAQG"}

35
node_modules/@jest/core/build/lib/create_context.js generated vendored Normal file
View file

@ -0,0 +1,35 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestRuntime() {
const data = _interopRequireDefault(require('jest-runtime'));
_jestRuntime = function _jestRuntime() {
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.
*/
var _default = (config, {hasteFS, moduleMap}) => ({
config,
hasteFS,
moduleMap,
resolver: _jestRuntime().default.createResolver(config, moduleMap)
});
exports.default = _default;

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.
*/
/// <reference types="node" />
declare const _default: (pipe: NodeJS.WriteStream, stdin?: NodeJS.ReadStream) => Promise<void>;
export default _default;
//# sourceMappingURL=handle_deprecation_warnings.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"handle_deprecation_warnings.d.ts","sourceRoot":"","sources":["../../src/lib/handle_deprecation_warnings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;AAKH,wBA6BK"}

View file

@ -0,0 +1,72 @@
'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 _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
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.
*/
var _default = (pipe, stdin = process.stdin) =>
new Promise((resolve, reject) => {
if (typeof stdin.setRawMode === 'function') {
const messages = [
_chalk().default.red('There are deprecation warnings.\n'),
_chalk().default.dim(' \u203A Press ') +
'Enter' +
_chalk().default.dim(' to continue.'),
_chalk().default.dim(' \u203A Press ') +
'Esc' +
_chalk().default.dim(' to exit.')
];
pipe.write(messages.join('\n'));
stdin.setRawMode(true);
stdin.resume();
stdin.setEncoding('utf8');
stdin.on('data', key => {
if (key === _jestWatcher().KEYS.ENTER) {
resolve();
} else if (
[
_jestWatcher().KEYS.ESCAPE,
_jestWatcher().KEYS.CONTROL_C,
_jestWatcher().KEYS.CONTROL_D
].indexOf(key) !== -1
) {
reject();
}
});
} else {
resolve();
}
});
exports.default = _default;

9
node_modules/@jest/core/build/lib/is_valid_path.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 isValidPath(globalConfig: Config.GlobalConfig, filePath: Config.Path): boolean;
//# sourceMappingURL=is_valid_path.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"is_valid_path.d.ts","sourceRoot":"","sources":["../../src/lib/is_valid_path.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGnC,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,QAAQ,EAAE,MAAM,CAAC,IAAI,WAMtB"}

29
node_modules/@jest/core/build/lib/is_valid_path.js generated vendored Normal file
View file

@ -0,0 +1,29 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = isValidPath;
function _jestSnapshot() {
const data = require('jest-snapshot');
_jestSnapshot = function _jestSnapshot() {
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.
*/
function isValidPath(globalConfig, filePath) {
return (
!filePath.includes(globalConfig.coverageDirectory) &&
!(0, _jestSnapshot().isSnapshotPath)(filePath)
);
}

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.
*/
/// <reference types="node" />
import { Config } from '@jest/types';
export default function logDebugMessages(globalConfig: Config.GlobalConfig, configs: Array<Config.ProjectConfig> | Config.ProjectConfig, outputStream: NodeJS.WriteStream): void;
//# sourceMappingURL=log_debug_messages.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"log_debug_messages.d.ts","sourceRoot":"","sources":["../../src/lib/log_debug_messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAInC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,aAAa,EAC3D,YAAY,EAAE,MAAM,CAAC,WAAW,GAC/B,IAAI,CAON"}

View file

@ -0,0 +1,23 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = logDebugMessages;
/**
* 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 VERSION = require('../../package.json').version;
function logDebugMessages(globalConfig, configs, outputStream) {
const output = {
configs,
globalConfig,
version: VERSION
};
outputStream.write(JSON.stringify(output, null, ' ') + '\n');
}

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 _default: (globalConfig: Config.GlobalConfig, options?: Partial<Pick<Config.GlobalConfig, "bail" | "changedSince" | "collectCoverage" | "collectCoverageFrom" | "collectCoverageOnlyFrom" | "coverageDirectory" | "coverageReporters" | "notify" | "notifyMode" | "onlyFailures" | "reporters" | "testNamePattern" | "testPathPattern" | "updateSnapshot" | "verbose"> & {
mode: "watch" | "watchAll";
}> & Partial<Pick<Config.GlobalConfig, "noSCM" | "passWithNoTests">>) => Config.GlobalConfig;
export default _default;
//# sourceMappingURL=update_global_config.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"update_global_config.d.ts","sourceRoot":"","sources":["../../src/lib/update_global_config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;;;;AAOnC,wBA4FE"}

View file

@ -0,0 +1,142 @@
'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 _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;
}
var _default = (globalConfig, options = {}) => {
const newConfig = _objectSpread({}, globalConfig);
if (options.mode === 'watch') {
newConfig.watch = true;
newConfig.watchAll = false;
} else if (options.mode === 'watchAll') {
newConfig.watch = false;
newConfig.watchAll = true;
}
if (options.testNamePattern !== undefined) {
newConfig.testNamePattern = options.testNamePattern || '';
}
if (options.testPathPattern !== undefined) {
newConfig.testPathPattern =
(0, _jestRegexUtil().replacePathSepForRegex)(options.testPathPattern) ||
'';
}
newConfig.onlyChanged = false;
newConfig.onlyChanged =
!newConfig.watchAll &&
!newConfig.testNamePattern &&
!newConfig.testPathPattern;
if (typeof options.bail === 'boolean') {
newConfig.bail = options.bail ? 1 : 0;
} else if (options.bail !== undefined) {
newConfig.bail = options.bail;
}
if (options.changedSince !== undefined) {
newConfig.changedSince = options.changedSince;
}
if (options.collectCoverage !== undefined) {
newConfig.collectCoverage = options.collectCoverage || false;
}
if (options.collectCoverageFrom !== undefined) {
newConfig.collectCoverageFrom = options.collectCoverageFrom;
}
if (options.collectCoverageOnlyFrom !== undefined) {
newConfig.collectCoverageOnlyFrom = options.collectCoverageOnlyFrom;
}
if (options.coverageDirectory !== undefined) {
newConfig.coverageDirectory = options.coverageDirectory;
}
if (options.coverageReporters !== undefined) {
newConfig.coverageReporters = options.coverageReporters;
}
if (options.noSCM) {
newConfig.noSCM = true;
}
if (options.notify !== undefined) {
newConfig.notify = options.notify || false;
}
if (options.notifyMode !== undefined) {
newConfig.notifyMode = options.notifyMode;
}
if (options.onlyFailures !== undefined) {
newConfig.onlyFailures = options.onlyFailures || false;
}
if (options.passWithNoTests !== undefined) {
newConfig.passWithNoTests = true;
}
if (options.reporters !== undefined) {
newConfig.reporters = options.reporters;
}
if (options.updateSnapshot !== undefined) {
newConfig.updateSnapshot = options.updateSnapshot;
}
if (options.verbose !== undefined) {
newConfig.verbose = options.verbose || false;
}
return Object.freeze(newConfig);
};
exports.default = _default;

View file

@ -0,0 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Config } from '@jest/types';
import { WatchPlugin, UsageData } from 'jest-watcher';
export declare const filterInteractivePlugins: (watchPlugins: WatchPlugin[], globalConfig: Config.GlobalConfig) => WatchPlugin[];
export declare const getSortedUsageRows: (watchPlugins: WatchPlugin[], globalConfig: Config.GlobalConfig) => UsageData[];
//# sourceMappingURL=watch_plugins_helpers.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"watch_plugins_helpers.d.ts","sourceRoot":"","sources":["../../src/lib/watch_plugins_helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,wBAAwB,mFAiBpC,CAAC;AAMF,eAAO,MAAM,kBAAkB,iFAyBV,CAAC"}

View file

@ -0,0 +1,62 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.getSortedUsageRows = exports.filterInteractivePlugins = 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 filterInteractivePlugins = (watchPlugins, globalConfig) => {
const usageInfos = watchPlugins.map(
p => p.getUsageInfo && p.getUsageInfo(globalConfig)
);
return watchPlugins.filter((_plugin, i) => {
const usageInfo = usageInfos[i];
if (usageInfo) {
const key = usageInfo.key;
return !usageInfos.slice(i + 1).some(u => !!u && key === u.key);
}
return false;
});
};
exports.filterInteractivePlugins = filterInteractivePlugins;
function notEmpty(value) {
return value != null;
}
const getSortedUsageRows = (watchPlugins, globalConfig) =>
filterInteractivePlugins(watchPlugins, globalConfig)
.sort((a, b) => {
if (a.isInternal && b.isInternal) {
// internal plugins in the order we specify them
return 0;
}
if (a.isInternal !== b.isInternal) {
// external plugins afterwards
return a.isInternal ? -1 : 1;
}
const usageInfoA = a.getUsageInfo && a.getUsageInfo(globalConfig);
const usageInfoB = b.getUsageInfo && b.getUsageInfo(globalConfig);
if (usageInfoA && usageInfoB) {
// external plugins in alphabetical order
return usageInfoA.key.localeCompare(usageInfoB.key);
}
return 0;
})
.map(p => p.getUsageInfo && p.getUsageInfo(globalConfig))
.filter(notEmpty);
exports.getSortedUsageRows = getSortedUsageRows;

22
node_modules/@jest/core/build/plugins/quit.d.ts generated vendored Normal file
View file

@ -0,0 +1,22 @@
/**
* 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 { BaseWatchPlugin } from 'jest-watcher';
declare class QuitPlugin extends BaseWatchPlugin {
isInternal: true;
constructor(options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
run(): Promise<void>;
getUsageInfo(): {
key: string;
prompt: string;
};
}
export default QuitPlugin;
//# sourceMappingURL=quit.d.ts.map

1
node_modules/@jest/core/build/plugins/quit.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"quit.d.ts","sourceRoot":"","sources":["../../src/plugins/quit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,cAAM,UAAW,SAAQ,eAAe;IACtC,UAAU,EAAE,IAAI,CAAC;gBAEL,OAAO,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAA;KAAC;IAKrE,GAAG;IAQT,YAAY;;;;CAMb;AAED,eAAe,UAAU,CAAC"}

96
node_modules/@jest/core/build/plugins/quit.js generated vendored Normal file
View file

@ -0,0 +1,96 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
function _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;
}
class QuitPlugin extends _jestWatcher().BaseWatchPlugin {
constructor(options) {
super(options);
_defineProperty(this, 'isInternal', void 0);
this.isInternal = true;
}
run() {
var _this = this;
return _asyncToGenerator(function*() {
if (typeof _this._stdin.setRawMode === 'function') {
_this._stdin.setRawMode(false);
}
_this._stdout.write('\n');
process.exit(0);
})();
}
getUsageInfo() {
return {
key: 'q',
prompt: 'quit watch mode'
};
}
}
var _default = QuitPlugin;
exports.default = _default;

View file

@ -0,0 +1,25 @@
/**
* 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 { Config } from '@jest/types';
import { BaseWatchPlugin, Prompt, UpdateConfigCallback } from 'jest-watcher';
declare class TestNamePatternPlugin extends BaseWatchPlugin {
_prompt: Prompt;
isInternal: true;
constructor(options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
getUsageInfo(): {
key: string;
prompt: string;
};
onKey(key: string): void;
run(globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise<void>;
}
export default TestNamePatternPlugin;
//# sourceMappingURL=test_name_pattern.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"test_name_pattern.d.ts","sourceRoot":"","sources":["../../src/plugins/test_name_pattern.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,eAAe,EAAE,MAAM,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAI3E,cAAM,qBAAsB,SAAQ,eAAe;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,IAAI,CAAC;gBAEL,OAAO,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAA;KAAC;IAM3E,YAAY;;;;IAOZ,KAAK,CAAC,GAAG,EAAE,MAAM;IAIjB,GAAG,CACD,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,kBAAkB,EAAE,oBAAoB,GACvC,OAAO,CAAC,IAAI,CAAC;CAmBjB;AAED,eAAe,qBAAqB,CAAC"}

View file

@ -0,0 +1,91 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
var _TestNamePatternPrompt = _interopRequireDefault(
require('../TestNamePatternPrompt')
);
var _active_filters_message = _interopRequireDefault(
require('../lib/active_filters_message')
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
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;
}
class TestNamePatternPlugin extends _jestWatcher().BaseWatchPlugin {
constructor(options) {
super(options);
_defineProperty(this, '_prompt', void 0);
_defineProperty(this, 'isInternal', void 0);
this._prompt = new (_jestWatcher()).Prompt();
this.isInternal = true;
}
getUsageInfo() {
return {
key: 't',
prompt: 'filter by a test name regex pattern'
};
}
onKey(key) {
this._prompt.put(key);
}
run(globalConfig, updateConfigAndRun) {
return new Promise((res, rej) => {
const testNamePatternPrompt = new _TestNamePatternPrompt.default(
this._stdout,
this._prompt
);
testNamePatternPrompt.run(
value => {
updateConfigAndRun({
mode: 'watch',
testNamePattern: value
});
res();
},
rej,
{
header: (0, _active_filters_message.default)(globalConfig)
}
);
});
}
}
var _default = TestNamePatternPlugin;
exports.default = _default;

View file

@ -0,0 +1,25 @@
/**
* 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 { Config } from '@jest/types';
import { BaseWatchPlugin, UpdateConfigCallback } from 'jest-watcher';
declare class TestPathPatternPlugin extends BaseWatchPlugin {
private _prompt;
isInternal: true;
constructor(options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
getUsageInfo(): {
key: string;
prompt: string;
};
onKey(key: string): void;
run(globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise<void>;
}
export default TestPathPatternPlugin;
//# sourceMappingURL=test_path_pattern.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"test_path_pattern.d.ts","sourceRoot":"","sources":["../../src/plugins/test_path_pattern.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,eAAe,EAAU,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAI3E,cAAM,qBAAsB,SAAQ,eAAe;IACjD,OAAO,CAAC,OAAO,CAAS;IACxB,UAAU,EAAE,IAAI,CAAC;gBAEL,OAAO,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAA;KAAC;IAM3E,YAAY;;;;IAOZ,KAAK,CAAC,GAAG,EAAE,MAAM;IAIjB,GAAG,CACD,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,kBAAkB,EAAE,oBAAoB,GACvC,OAAO,CAAC,IAAI,CAAC;CAmBjB;AAED,eAAe,qBAAqB,CAAC"}

View file

@ -0,0 +1,91 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
var _TestPathPatternPrompt = _interopRequireDefault(
require('../TestPathPatternPrompt')
);
var _active_filters_message = _interopRequireDefault(
require('../lib/active_filters_message')
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
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;
}
class TestPathPatternPlugin extends _jestWatcher().BaseWatchPlugin {
constructor(options) {
super(options);
_defineProperty(this, '_prompt', void 0);
_defineProperty(this, 'isInternal', void 0);
this._prompt = new (_jestWatcher()).Prompt();
this.isInternal = true;
}
getUsageInfo() {
return {
key: 'p',
prompt: 'filter by a filename regex pattern'
};
}
onKey(key) {
this._prompt.put(key);
}
run(globalConfig, updateConfigAndRun) {
return new Promise((res, rej) => {
const testPathPatternPrompt = new _TestPathPatternPrompt.default(
this._stdout,
this._prompt
);
testPathPatternPrompt.run(
value => {
updateConfigAndRun({
mode: 'watch',
testPathPattern: value
});
res();
},
rej,
{
header: (0, _active_filters_message.default)(globalConfig)
}
);
});
}
}
var _default = TestPathPatternPlugin;
exports.default = _default;

View file

@ -0,0 +1,25 @@
/**
* 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 { Config } from '@jest/types';
import { BaseWatchPlugin, JestHookSubscriber, UpdateConfigCallback } from 'jest-watcher';
declare class UpdateSnapshotsPlugin extends BaseWatchPlugin {
private _hasSnapshotFailure;
isInternal: true;
constructor(options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
run(_globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise<boolean>;
apply(hooks: JestHookSubscriber): void;
getUsageInfo(): {
key: string;
prompt: string;
} | null;
}
export default UpdateSnapshotsPlugin;
//# sourceMappingURL=update_snapshots.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"update_snapshots.d.ts","sourceRoot":"","sources":["../../src/plugins/update_snapshots.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAEtB,cAAM,qBAAsB,SAAQ,eAAe;IACjD,OAAO,CAAC,mBAAmB,CAAU;IACrC,UAAU,EAAE,IAAI,CAAC;gBAEL,OAAO,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAA;KAAC;IAM3E,GAAG,CACD,aAAa,EAAE,MAAM,CAAC,YAAY,EAClC,kBAAkB,EAAE,oBAAoB,GACvC,OAAO,CAAC,OAAO,CAAC;IAKnB,KAAK,CAAC,KAAK,EAAE,kBAAkB;IAM/B,YAAY;;;;CAUb;AAED,eAAe,qBAAqB,CAAC"}

View file

@ -0,0 +1,70 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
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;
}
class UpdateSnapshotsPlugin extends _jestWatcher().BaseWatchPlugin {
constructor(options) {
super(options);
_defineProperty(this, '_hasSnapshotFailure', void 0);
_defineProperty(this, 'isInternal', void 0);
this.isInternal = true;
this._hasSnapshotFailure = false;
}
run(_globalConfig, updateConfigAndRun) {
updateConfigAndRun({
updateSnapshot: 'all'
});
return Promise.resolve(false);
}
apply(hooks) {
hooks.onTestRunComplete(results => {
this._hasSnapshotFailure = results.snapshot.failure;
});
}
getUsageInfo() {
if (this._hasSnapshotFailure) {
return {
key: 'u',
prompt: 'update failing snapshots'
};
}
return null;
}
}
var _default = UpdateSnapshotsPlugin;
exports.default = _default;

View file

@ -0,0 +1,24 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Config } from '@jest/types';
import { AggregatedResult, AssertionLocation } from '@jest/test-result';
import { BaseWatchPlugin, JestHookSubscriber } from 'jest-watcher';
declare class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin {
private _snapshotInteractiveMode;
private _failedSnapshotTestAssertions;
isInternal: true;
getFailedSnapshotTestAssertions(testResults: AggregatedResult): Array<AssertionLocation>;
apply(hooks: JestHookSubscriber): void;
onKey(key: string): void;
run(_globalConfig: Config.GlobalConfig, updateConfigAndRun: Function): Promise<void>;
getUsageInfo(): {
key: string;
prompt: string;
} | null;
}
export default UpdateSnapshotInteractivePlugin;
//# sourceMappingURL=update_snapshots_interactive.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"update_snapshots_interactive.d.ts","sourceRoot":"","sources":["../../src/plugins/update_snapshots_interactive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAGjE,cAAM,+BAAgC,SAAQ,eAAe;IAC3D,OAAO,CAAC,wBAAwB,CAE9B;IACF,OAAO,CAAC,6BAA6B,CAAgC;IACrE,UAAU,EAAE,IAAI,CAAQ;IAExB,+BAA+B,CAC7B,WAAW,EAAE,gBAAgB,GAC5B,KAAK,CAAC,iBAAiB,CAAC;IAsB3B,KAAK,CAAC,KAAK,EAAE,kBAAkB;IAW/B,KAAK,CAAC,GAAG,EAAE,MAAM;IAMjB,GAAG,CACD,aAAa,EAAE,MAAM,CAAC,YAAY,EAClC,kBAAkB,EAAE,QAAQ,GAC3B,OAAO,CAAC,IAAI,CAAC;IAwBhB,YAAY;;;;CAab;AAED,eAAe,+BAA+B,CAAC"}

View file

@ -0,0 +1,135 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
var _SnapshotInteractiveMode = _interopRequireDefault(
require('../SnapshotInteractiveMode')
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
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;
}
class UpdateSnapshotInteractivePlugin extends _jestWatcher().BaseWatchPlugin {
constructor(...args) {
super(...args);
_defineProperty(
this,
'_snapshotInteractiveMode',
new _SnapshotInteractiveMode.default(this._stdout)
);
_defineProperty(this, '_failedSnapshotTestAssertions', []);
_defineProperty(this, 'isInternal', true);
}
getFailedSnapshotTestAssertions(testResults) {
const failedTestPaths = [];
if (testResults.numFailedTests === 0 || !testResults.testResults) {
return failedTestPaths;
}
testResults.testResults.forEach(testResult => {
if (testResult.snapshot && testResult.snapshot.unmatched) {
testResult.testResults.forEach(result => {
if (result.status === 'failed') {
failedTestPaths.push({
fullName: result.fullName,
path: testResult.testFilePath
});
}
});
}
});
return failedTestPaths;
}
apply(hooks) {
hooks.onTestRunComplete(results => {
this._failedSnapshotTestAssertions = this.getFailedSnapshotTestAssertions(
results
);
if (this._snapshotInteractiveMode.isActive()) {
this._snapshotInteractiveMode.updateWithResults(results);
}
});
}
onKey(key) {
if (this._snapshotInteractiveMode.isActive()) {
this._snapshotInteractiveMode.put(key);
}
}
run(_globalConfig, updateConfigAndRun) {
if (this._failedSnapshotTestAssertions.length) {
return new Promise(res => {
this._snapshotInteractiveMode.run(
this._failedSnapshotTestAssertions,
(assertion, shouldUpdateSnapshot) => {
updateConfigAndRun({
mode: 'watch',
testNamePattern: assertion ? `^${assertion.fullName}$` : '',
testPathPattern: assertion ? assertion.path : '',
updateSnapshot: shouldUpdateSnapshot ? 'all' : 'none'
});
if (!this._snapshotInteractiveMode.isActive()) {
res();
}
}
);
});
} else {
return Promise.resolve();
}
}
getUsageInfo() {
if (
this._failedSnapshotTestAssertions &&
this._failedSnapshotTestAssertions.length > 0
) {
return {
key: 'i',
prompt: 'update failing snapshots interactively'
};
}
return null;
}
}
var _default = UpdateSnapshotInteractivePlugin;
exports.default = _default;

8
node_modules/@jest/core/build/pluralize.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 pluralize(word: string, count: number, ending: string): string;
//# sourceMappingURL=pluralize.d.ts.map

1
node_modules/@jest/core/build/pluralize.d.ts.map generated vendored Normal file
View file

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

16
node_modules/@jest/core/build/pluralize.js generated vendored Normal file
View file

@ -0,0 +1,16 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = pluralize;
/**
* 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 pluralize(word, count, ending) {
return `${count} ${word}${count === 1 ? '' : ending}`;
}

14
node_modules/@jest/core/build/runGlobalHook.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 const _default: ({ allTests, globalConfig, moduleName, }: {
allTests: import("jest-runner/build/types").Test[];
globalConfig: Config.GlobalConfig;
moduleName: "globalSetup" | "globalTeardown";
}) => Promise<void>;
export default _default;
//# sourceMappingURL=runGlobalHook.d.ts.map

1
node_modules/@jest/core/build/runGlobalHook.d.ts.map generated vendored Normal file
View file

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

149
node_modules/@jest/core/build/runGlobalHook.js generated vendored Normal file
View file

@ -0,0 +1,149 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _pEachSeries() {
const data = _interopRequireDefault(require('p-each-series'));
_pEachSeries = function _pEachSeries() {
return data;
};
return data;
}
function _transform() {
const data = require('@jest/transform');
_transform = function _transform() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
var _default =
/*#__PURE__*/
(function() {
var _ref = _asyncToGenerator(function*({
allTests,
globalConfig,
moduleName
}) {
const globalModulePaths = new Set(
allTests.map(test => test.context.config[moduleName])
);
if (globalConfig[moduleName]) {
globalModulePaths.add(globalConfig[moduleName]);
}
if (globalModulePaths.size > 0) {
yield (0, _pEachSeries().default)(
Array.from(globalModulePaths),
/*#__PURE__*/
(function() {
var _ref2 = _asyncToGenerator(function*(modulePath) {
if (!modulePath) {
return;
}
const correctConfig = allTests.find(
t => t.context.config[moduleName] === modulePath
);
const projectConfig = correctConfig
? correctConfig.context.config // Fallback to first config
: allTests[0].context.config;
const transformer = new (_transform()).ScriptTransformer(
projectConfig
);
yield transformer.requireAndTranspileModule(
modulePath,
/*#__PURE__*/
(function() {
var _ref3 = _asyncToGenerator(function*(m) {
const globalModule = (0, _jestUtil().interopRequireDefault)(
m
).default;
if (typeof globalModule !== 'function') {
throw new TypeError(
`${moduleName} file must export a function at ${modulePath}`
);
}
yield globalModule(globalConfig);
});
return function(_x3) {
return _ref3.apply(this, arguments);
};
})()
);
});
return function(_x2) {
return _ref2.apply(this, arguments);
};
})()
);
}
return Promise.resolve();
});
return function(_x) {
return _ref.apply(this, arguments);
};
})();
exports.default = _default;

28
node_modules/@jest/core/build/runJest.d.ts generated vendored Normal file
View file

@ -0,0 +1,28 @@
/**
* 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 { JestHookEmitter } from 'jest-watcher';
import { Config } from '@jest/types';
import { AggregatedResult } from '@jest/test-result';
import { ChangedFiles } from 'jest-changed-files';
import FailedTestsCache from './FailedTestsCache';
import TestWatcher from './TestWatcher';
import { Filter } from './types';
declare const _default: ({ contexts, globalConfig, outputStream, testWatcher, jestHooks, startRun, changedFilesPromise, onComplete, failedTestsCache, filter, }: {
globalConfig: Config.GlobalConfig;
contexts: import("jest-runtime/build/types").Context[];
outputStream: NodeJS.WritableStream;
testWatcher: TestWatcher;
jestHooks?: JestHookEmitter | undefined;
startRun: (globalConfig: Config.GlobalConfig) => void;
changedFilesPromise?: Promise<ChangedFiles> | undefined;
onComplete: (testResults: AggregatedResult) => void;
failedTestsCache?: FailedTestsCache | undefined;
filter?: Filter | undefined;
}) => Promise<void | null>;
export default _default;
//# sourceMappingURL=runJest.d.ts.map

1
node_modules/@jest/core/build/runJest.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"runJest.d.ts","sourceRoot":"","sources":["../src/runJest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AASH,OAAO,EAAW,eAAe,EAAC,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EACL,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAC,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAKrE,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAc,MAAM,EAAC,MAAM,SAAS,CAAC;;;;;;;;;;;;;AA2F5C,wBAgJG"}

446
node_modules/@jest/core/build/runJest.js generated vendored Normal file
View file

@ -0,0 +1,446 @@
'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 _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
function _realpathNative() {
const data = require('realpath-native');
_realpathNative = function _realpathNative() {
return data;
};
return data;
}
function _console() {
const data = require('@jest/console');
_console = function _console() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
return data;
};
return data;
}
function _exit() {
const data = _interopRequireDefault(require('exit'));
_exit = function _exit() {
return data;
};
return data;
}
function _gracefulFs() {
const data = _interopRequireDefault(require('graceful-fs'));
_gracefulFs = function _gracefulFs() {
return data;
};
return data;
}
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function _jestWatcher() {
return data;
};
return data;
}
function _testResult() {
const data = require('@jest/test-result');
_testResult = function _testResult() {
return data;
};
return data;
}
var _getNoTestsFoundMessage = _interopRequireDefault(
require('./getNoTestsFoundMessage')
);
var _runGlobalHook = _interopRequireDefault(require('./runGlobalHook'));
var _SearchSource = _interopRequireDefault(require('./SearchSource'));
var _TestScheduler = _interopRequireDefault(require('./TestScheduler'));
var _collectHandles = _interopRequireDefault(require('./collectHandles'));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
const getTestPaths =
/*#__PURE__*/
(function() {
var _ref = _asyncToGenerator(function*(
globalConfig,
context,
outputStream,
changedFiles,
jestHooks,
filter
) {
const source = new _SearchSource.default(context);
const data = yield source.getTestPaths(
globalConfig,
changedFiles,
filter
);
if (!data.tests.length && globalConfig.onlyChanged && data.noSCM) {
new (_console()).CustomConsole(outputStream, outputStream).log(
'Jest can only find uncommitted changed files in a git or hg ' +
'repository. If you make your project a git or hg ' +
'repository (`git init` or `hg init`), Jest will be able ' +
'to only run tests related to files changed since the last ' +
'commit.'
);
}
const shouldTestArray = yield Promise.all(
data.tests.map(test =>
jestHooks.shouldRunTestSuite({
config: test.context.config,
duration: test.duration,
testPath: test.path
})
)
);
const filteredTests = data.tests.filter((_test, i) => shouldTestArray[i]);
return _objectSpread({}, data, {
allTests: filteredTests.length,
tests: filteredTests
});
});
return function getTestPaths(_x, _x2, _x3, _x4, _x5, _x6) {
return _ref.apply(this, arguments);
};
})();
const processResults = (runResults, options) => {
const outputFile = options.outputFile,
isJSON = options.json,
onComplete = options.onComplete,
outputStream = options.outputStream,
testResultsProcessor = options.testResultsProcessor,
collectHandles = options.collectHandles;
if (collectHandles) {
runResults.openHandles = collectHandles();
} else {
runResults.openHandles = [];
}
if (testResultsProcessor) {
runResults = require(testResultsProcessor)(runResults);
}
if (isJSON) {
if (outputFile) {
const cwd = (0, _realpathNative().sync)(process.cwd());
const filePath = _path().default.resolve(cwd, outputFile);
_gracefulFs().default.writeFileSync(
filePath,
JSON.stringify((0, _jestUtil().formatTestResults)(runResults))
);
outputStream.write(
`Test results written to: ${_path().default.relative(cwd, filePath)}\n`
);
} else {
process.stdout.write(
JSON.stringify((0, _jestUtil().formatTestResults)(runResults))
);
}
}
return onComplete && onComplete(runResults);
};
const testSchedulerContext = {
firstRun: true,
previousSuccess: true
};
var _default =
/*#__PURE__*/
(function() {
var _runJest = _asyncToGenerator(function*({
contexts,
globalConfig,
outputStream,
testWatcher,
jestHooks = new (_jestWatcher()).JestHook().getEmitter(),
startRun,
changedFilesPromise,
onComplete,
failedTestsCache,
filter
}) {
const Sequencer = (0, _jestUtil().interopRequireDefault)(
require(globalConfig.testSequencer)
).default;
const sequencer = new Sequencer();
let allTests = [];
if (changedFilesPromise && globalConfig.watch) {
const _ref2 = yield changedFilesPromise,
repos = _ref2.repos;
const noSCM = Object.keys(repos).every(scm => repos[scm].size === 0);
if (noSCM) {
process.stderr.write(
'\n' +
_chalk().default.bold('--watch') +
' is not supported without git/hg, please use --watchAll ' +
'\n'
);
(0, _exit().default)(1);
}
}
const testRunData = yield Promise.all(
contexts.map(
/*#__PURE__*/
(function() {
var _ref3 = _asyncToGenerator(function*(context) {
const matches = yield getTestPaths(
globalConfig,
context,
outputStream,
changedFilesPromise && (yield changedFilesPromise),
jestHooks,
filter
);
allTests = allTests.concat(matches.tests);
return {
context,
matches
};
});
return function(_x8) {
return _ref3.apply(this, arguments);
};
})()
)
);
allTests = yield sequencer.sort(allTests);
if (globalConfig.listTests) {
const testsPaths = Array.from(new Set(allTests.map(test => test.path)));
if (globalConfig.json) {
console.log(JSON.stringify(testsPaths));
} else {
console.log(testsPaths.join('\n'));
}
onComplete &&
onComplete((0, _testResult().makeEmptyAggregatedTestResult)());
return null;
}
if (globalConfig.onlyFailures && failedTestsCache) {
allTests = failedTestsCache.filterTests(allTests);
globalConfig = failedTestsCache.updateConfig(globalConfig);
}
const hasTests = allTests.length > 0;
if (!hasTests) {
const noTestsFoundMessage = (0, _getNoTestsFoundMessage.default)(
testRunData,
globalConfig
);
if (
globalConfig.passWithNoTests ||
globalConfig.findRelatedTests ||
globalConfig.lastCommit ||
globalConfig.onlyChanged
) {
new (_console()).CustomConsole(outputStream, outputStream).log(
noTestsFoundMessage
);
} else {
new (_console()).CustomConsole(outputStream, outputStream).error(
noTestsFoundMessage
);
(0, _exit().default)(1);
}
} else if (
allTests.length === 1 &&
globalConfig.silent !== true &&
globalConfig.verbose !== false
) {
const newConfig = _objectSpread({}, globalConfig, {
verbose: true
});
globalConfig = Object.freeze(newConfig);
}
let collectHandles;
if (globalConfig.detectOpenHandles) {
collectHandles = (0, _collectHandles.default)();
}
if (hasTests) {
yield (0, _runGlobalHook.default)({
allTests,
globalConfig,
moduleName: 'globalSetup'
});
}
if (changedFilesPromise) {
testSchedulerContext.changedFiles = (yield changedFilesPromise).changedFiles;
}
const results = yield new _TestScheduler.default(
globalConfig,
{
startRun
},
testSchedulerContext
).scheduleTests(allTests, testWatcher);
sequencer.cacheResults(allTests, results);
if (hasTests) {
yield (0, _runGlobalHook.default)({
allTests,
globalConfig,
moduleName: 'globalTeardown'
});
}
return processResults(results, {
collectHandles,
json: globalConfig.json,
onComplete,
outputFile: globalConfig.outputFile,
outputStream,
testResultsProcessor: globalConfig.testResultsProcessor
});
});
function runJest(_x7) {
return _runJest.apply(this, arguments);
}
return runJest;
})();
exports.default = _default;

Some files were not shown because too many files have changed in this diff Show more