This commit is contained in:
eric sciple 2020-01-24 12:21:24 -05:00
parent fc725ba36b
commit 422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions

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

@ -0,0 +1,23 @@
MIT License
For Jest software
Copyright (c) 2014-present, Facebook, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

21
node_modules/jest-runner/build/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,21 @@
/**
* 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 { OnTestFailure, OnTestStart, OnTestSuccess, Test as JestTest, TestRunnerContext, TestRunnerOptions, TestWatcher } from './types';
declare namespace TestRunner {
type Test = JestTest;
}
declare class TestRunner {
private _globalConfig;
private _context;
constructor(globalConfig: Config.GlobalConfig, context?: TestRunnerContext);
runTests(tests: Array<JestTest>, watcher: TestWatcher, onStart: OnTestStart, onResult: OnTestSuccess, onFailure: OnTestFailure, options: TestRunnerOptions): Promise<void>;
private _createInBandTestRun;
private _createParallelTestRun;
}
export = TestRunner;
//# sourceMappingURL=index.d.ts.map

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

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAOnC,OAAO,EACL,aAAa,EACb,WAAW,EACX,aAAa,EACb,IAAI,IAAI,QAAQ,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EAEZ,MAAM,SAAS,CAAC;AAQjB,kBAAU,UAAU,CAAC;IACnB,KAAY,IAAI,GAAG,QAAQ,CAAC;CAC7B;AAGD,cAAM,UAAU;IACd,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,QAAQ,CAAoB;gBAExB,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAKpE,QAAQ,CACZ,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,EACtB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC;YAYF,oBAAoB;YAkCpB,sBAAsB;CAuFrC;AASD,SAAS,UAAU,CAAC"}

298
node_modules/jest-runner/build/index.js generated vendored Normal file
View file

@ -0,0 +1,298 @@
'use strict';
function _exit() {
const data = _interopRequireDefault(require('exit'));
_exit = function _exit() {
return data;
};
return data;
}
function _throat() {
const data = _interopRequireDefault(require('throat'));
_throat = function _throat() {
return data;
};
return data;
}
function _jestWorker() {
const data = _interopRequireDefault(require('jest-worker'));
_jestWorker = function _jestWorker() {
return data;
};
return data;
}
var _runTest = _interopRequireDefault(require('./runTest'));
var _testWorker = require('./testWorker');
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 TEST_WORKER_PATH = require.resolve('./testWorker');
/* eslint-disable-next-line no-redeclare */
class TestRunner {
constructor(globalConfig, context) {
_defineProperty(this, '_globalConfig', void 0);
_defineProperty(this, '_context', void 0);
this._globalConfig = globalConfig;
this._context = context || {};
}
runTests(tests, watcher, onStart, onResult, onFailure, options) {
var _this = this;
return _asyncToGenerator(function*() {
return yield options.serial
? _this._createInBandTestRun(
tests,
watcher,
onStart,
onResult,
onFailure
)
: _this._createParallelTestRun(
tests,
watcher,
onStart,
onResult,
onFailure
);
})();
}
_createInBandTestRun(tests, watcher, onStart, onResult, onFailure) {
var _this2 = this;
return _asyncToGenerator(function*() {
process.env.JEST_WORKER_ID = '1';
const mutex = (0, _throat().default)(1);
return tests.reduce(
(promise, test) =>
mutex(() =>
promise
.then(
/*#__PURE__*/
_asyncToGenerator(function*() {
if (watcher.isInterrupted()) {
throw new CancelRun();
}
yield onStart(test);
return (0,
_runTest.default)(test.path, _this2._globalConfig, test.context.config, test.context.resolver, _this2._context);
})
)
.then(result => onResult(test, result))
.catch(err => onFailure(test, err))
),
Promise.resolve()
);
})();
}
_createParallelTestRun(tests, watcher, onStart, onResult, onFailure) {
var _this3 = this;
return _asyncToGenerator(function*() {
const resolvers = new Map();
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (
var _iterator = tests[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
_iteratorNormalCompletion = true
) {
const test = _step.value;
if (!resolvers.has(test.context.config.name)) {
resolvers.set(test.context.config.name, {
config: test.context.config,
serializableModuleMap: test.context.moduleMap.toJSON()
});
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
const worker = new (_jestWorker()).default(TEST_WORKER_PATH, {
exposedMethods: ['worker'],
forkOptions: {
stdio: 'pipe'
},
maxRetries: 3,
numWorkers: _this3._globalConfig.maxWorkers,
setupArgs: [
{
serializableResolvers: Array.from(resolvers.values())
}
]
});
if (worker.getStdout()) worker.getStdout().pipe(process.stdout);
if (worker.getStderr()) worker.getStderr().pipe(process.stderr);
const mutex = (0, _throat().default)(_this3._globalConfig.maxWorkers); // Send test suites to workers continuously instead of all at once to track
// the start time of individual tests.
const runTestInWorker = test =>
mutex(
/*#__PURE__*/
_asyncToGenerator(function*() {
if (watcher.isInterrupted()) {
return Promise.reject();
}
yield onStart(test);
return worker.worker({
config: test.context.config,
context: _objectSpread({}, _this3._context, {
changedFiles:
_this3._context.changedFiles &&
Array.from(_this3._context.changedFiles)
}),
globalConfig: _this3._globalConfig,
path: test.path
});
})
);
const onError =
/*#__PURE__*/
(function() {
var _ref3 = _asyncToGenerator(function*(err, test) {
yield onFailure(test, err);
if (err.type === 'ProcessTerminatedError') {
console.error(
'A worker process has quit unexpectedly! ' +
'Most likely this is an initialization error.'
);
(0, _exit().default)(1);
}
});
return function onError(_x, _x2) {
return _ref3.apply(this, arguments);
};
})();
const onInterrupt = new Promise((_, reject) => {
watcher.on('change', state => {
if (state.interrupted) {
reject(new CancelRun());
}
});
});
const runAllTests = Promise.all(
tests.map(test =>
runTestInWorker(test)
.then(testResult => onResult(test, testResult))
.catch(error => onError(error, test))
)
);
const cleanup = () => worker.end();
return Promise.race([runAllTests, onInterrupt]).then(cleanup, cleanup);
})();
}
}
class CancelRun extends Error {
constructor(message) {
super(message);
this.name = 'CancelRun';
}
}
module.exports = TestRunner;

13
node_modules/jest-runner/build/runTest.d.ts generated vendored Normal file
View file

@ -0,0 +1,13 @@
/**
* 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 { TestResult } from '@jest/test-result';
import Resolver from 'jest-resolve';
import { TestRunnerContext } from './types';
export default function runTest(path: Config.Path, globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, resolver: Resolver, context?: TestRunnerContext): Promise<TestResult>;
//# sourceMappingURL=runTest.d.ts.map

1
node_modules/jest-runner/build/runTest.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"runTest.d.ts","sourceRoot":"","sources":["../src/runTest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAc7C,OAAO,QAAQ,MAAM,cAAc,CAAC;AAQpC,OAAO,EAAgB,iBAAiB,EAAC,MAAM,SAAS,CAAC;AA4PzD,wBAA8B,OAAO,CACnC,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,MAAM,EAAE,MAAM,CAAC,aAAa,EAC5B,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAoBrB"}

482
node_modules/jest-runner/build/runTest.js generated vendored Normal file
View file

@ -0,0 +1,482 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = runTest;
function _console() {
const data = require('@jest/console');
_console = function _console() {
return data;
};
return data;
}
function _gracefulFs() {
const data = _interopRequireDefault(require('graceful-fs'));
_gracefulFs = function _gracefulFs() {
return data;
};
return data;
}
function _jestUtil() {
const data = require('jest-util');
_jestUtil = function _jestUtil() {
return data;
};
return data;
}
function _jestLeakDetector() {
const data = _interopRequireDefault(require('jest-leak-detector'));
_jestLeakDetector = function _jestLeakDetector() {
return data;
};
return data;
}
function _jestConfig() {
const data = require('jest-config');
_jestConfig = function _jestConfig() {
return data;
};
return data;
}
function docblock() {
const data = _interopRequireWildcard(require('jest-docblock'));
docblock = function docblock() {
return data;
};
return data;
}
function _jestMessageUtil() {
const data = require('jest-message-util');
_jestMessageUtil = function _jestMessageUtil() {
return data;
};
return data;
}
function _sourceMapSupport() {
const data = _interopRequireDefault(require('source-map-support'));
_sourceMapSupport = function _sourceMapSupport() {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function _chalk() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc =
Object.defineProperty && Object.getOwnPropertyDescriptor
? Object.getOwnPropertyDescriptor(obj, key)
: {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
function freezeConsole(testConsole, config) {
// @ts-ignore: `_log` is `private` - we should figure out some proper API here
testConsole._log = function fakeConsolePush(_type, message) {
const error = new (_jestUtil()).ErrorWithStack(
`${_chalk().default.red(
`${_chalk().default.bold(
'Cannot log after tests are done.'
)} Did you forget to wait for something async in your test?`
)}\nAttempted to log "${message}".`,
fakeConsolePush
);
const formattedError = (0, _jestMessageUtil().formatExecError)(
error,
config,
{
noStackTrace: false
},
undefined,
true
);
process.stderr.write('\n' + formattedError + '\n'); // TODO: set exit code in Jest 25
// process.exitCode = 1;
};
} // Keeping the core of "runTest" as a separate function (as "runTestInternal")
// is key to be able to detect memory leaks. Since all variables are local to
// the function, when "runTestInternal" finishes its execution, they can all be
// freed, UNLESS something else is leaking them (and that's why we can detect
// the leak!).
//
// If we had all the code in a single function, we should manually nullify all
// references to verify if there is a leak, which is not maintainable and error
// prone. That's why "runTestInternal" CANNOT be inlined inside "runTest".
function runTestInternal(_x, _x2, _x3, _x4, _x5) {
return _runTestInternal.apply(this, arguments);
}
function _runTestInternal() {
_runTestInternal = _asyncToGenerator(function*(
path,
globalConfig,
config,
resolver,
context
) {
const testSource = _gracefulFs().default.readFileSync(path, 'utf8');
const docblockPragmas = docblock().parse(docblock().extract(testSource));
const customEnvironment = docblockPragmas['jest-environment'];
let testEnvironment = config.testEnvironment;
if (customEnvironment) {
if (Array.isArray(customEnvironment)) {
throw new Error(
`You can only define a single test environment through docblocks, got "${customEnvironment.join(
', '
)}"`
);
}
testEnvironment = (0, _jestConfig().getTestEnvironment)(
_objectSpread({}, config, {
testEnvironment: customEnvironment
})
);
}
const TestEnvironment = (0, _jestUtil().interopRequireDefault)(
require(testEnvironment)
).default;
const testFramework =
process.env.JEST_CIRCUS === '1'
? require('jest-circus/runner') // eslint-disable-line import/no-extraneous-dependencies
: require(config.testRunner);
const Runtime = config.moduleLoader
? require(config.moduleLoader)
: require('jest-runtime');
let runtime = undefined;
const consoleOut = globalConfig.useStderr ? process.stderr : process.stdout;
const consoleFormatter = (type, message) =>
(0, _console().getConsoleOutput)(
config.cwd,
!!globalConfig.verbose, // 4 = the console call is buried 4 stack frames deep
_console().BufferedConsole.write(
[],
type,
message,
4,
runtime && runtime.getSourceMaps()
)
);
let testConsole;
if (globalConfig.silent) {
testConsole = new (_console()).NullConsole(
consoleOut,
consoleOut,
consoleFormatter
);
} else if (globalConfig.verbose) {
testConsole = new (_console()).CustomConsole(
consoleOut,
consoleOut,
consoleFormatter
);
} else {
testConsole = new (_console()).BufferedConsole(
() => runtime && runtime.getSourceMaps()
);
}
const environment = new TestEnvironment(config, {
console: testConsole,
docblockPragmas,
testPath: path
});
const leakDetector = config.detectLeaks
? new (_jestLeakDetector()).default(environment)
: null;
const cacheFS = {
[path]: testSource
};
(0, _jestUtil().setGlobal)(environment.global, 'console', testConsole);
runtime = new Runtime(config, environment, resolver, cacheFS, {
changedFiles: context && context.changedFiles,
collectCoverage: globalConfig.collectCoverage,
collectCoverageFrom: globalConfig.collectCoverageFrom,
collectCoverageOnlyFrom: globalConfig.collectCoverageOnlyFrom
});
const start = Date.now();
const sourcemapOptions = {
environment: 'node',
handleUncaughtExceptions: false,
retrieveSourceMap: source => {
const sourceMaps = runtime && runtime.getSourceMaps();
const sourceMapSource = sourceMaps && sourceMaps[source];
if (sourceMapSource) {
try {
return {
map: JSON.parse(
_gracefulFs().default.readFileSync(sourceMapSource, 'utf8')
),
url: source
};
} catch (e) {}
}
return null;
}
}; // For tests
runtime
.requireInternalModule(
require.resolve('source-map-support'),
'source-map-support'
)
.install(sourcemapOptions); // For runtime errors
_sourceMapSupport().default.install(sourcemapOptions);
if (
environment.global &&
environment.global.process &&
environment.global.process.exit
) {
const realExit = environment.global.process.exit;
environment.global.process.exit = function exit(...args) {
const error = new (_jestUtil()).ErrorWithStack(
`process.exit called with "${args.join(', ')}"`,
exit
);
const formattedError = (0, _jestMessageUtil().formatExecError)(
error,
config,
{
noStackTrace: false
},
undefined,
true
);
process.stderr.write(formattedError);
return realExit(...args);
};
}
try {
yield environment.setup();
let result;
try {
result = yield testFramework(
globalConfig,
config,
environment,
runtime,
path
);
} catch (err) {
// Access stack before uninstalling sourcemaps
err.stack;
throw err;
}
freezeConsole(testConsole, config);
const testCount =
result.numPassingTests +
result.numFailingTests +
result.numPendingTests +
result.numTodoTests;
result.perfStats = {
end: Date.now(),
start
};
result.testFilePath = path;
result.console = testConsole.getBuffer();
result.skipped = testCount === result.numPendingTests;
result.displayName = config.displayName;
const coverage = runtime.getAllCoverageInfoCopy();
if (coverage) {
const coverageKeys = Object.keys(coverage);
if (coverageKeys.length) {
result.coverage = coverage;
result.sourceMaps = runtime.getSourceMapInfo(new Set(coverageKeys));
}
}
if (globalConfig.logHeapUsage) {
if (global.gc) {
global.gc();
}
result.memoryUsage = process.memoryUsage().heapUsed;
} // Delay the resolution to allow log messages to be output.
return new Promise(resolve => {
setImmediate(() =>
resolve({
leakDetector,
result
})
);
});
} finally {
yield environment.teardown();
_sourceMapSupport().default.resetRetrieveHandlers();
}
});
return _runTestInternal.apply(this, arguments);
}
function runTest(_x6, _x7, _x8, _x9, _x10) {
return _runTest.apply(this, arguments);
}
function _runTest() {
_runTest = _asyncToGenerator(function*(
path,
globalConfig,
config,
resolver,
context
) {
const _ref = yield runTestInternal(
path,
globalConfig,
config,
resolver,
context
),
leakDetector = _ref.leakDetector,
result = _ref.result;
if (leakDetector) {
// We wanna allow a tiny but time to pass to allow last-minute cleanup
yield new Promise(resolve => setTimeout(resolve, 100)); // Resolve leak detector, outside the "runTestInternal" closure.
result.leaks = leakDetector.isLeaking();
} else {
result.leaks = false;
}
return result;
});
return _runTest.apply(this, arguments);
}

27
node_modules/jest-runner/build/testWorker.d.ts generated vendored Normal file
View file

@ -0,0 +1,27 @@
/**
* 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 { TestResult } from '@jest/test-result';
import { SerializableModuleMap } from 'jest-haste-map';
import { TestRunnerSerializedContext } from './types';
export declare type SerializableResolver = {
config: Config.ProjectConfig;
serializableModuleMap: SerializableModuleMap;
};
declare type WorkerData = {
config: Config.ProjectConfig;
globalConfig: Config.GlobalConfig;
path: Config.Path;
context?: TestRunnerSerializedContext;
};
export declare function setup(setupData: {
serializableResolvers: Array<SerializableResolver>;
}): void;
export declare function worker({ config, globalConfig, path, context, }: WorkerData): Promise<TestResult>;
export {};
//# sourceMappingURL=testWorker.d.ts.map

1
node_modules/jest-runner/build/testWorker.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"testWorker.d.ts","sourceRoot":"","sources":["../src/testWorker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAoB,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAChE,OAAiB,EAAC,qBAAqB,EAAC,MAAM,gBAAgB,CAAC;AAK/D,OAAO,EAAgB,2BAA2B,EAAC,MAAM,SAAS,CAAC;AAGnE,oBAAY,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC;IAC7B,qBAAqB,EAAE,qBAAqB,CAAC;CAC9C,CAAC;AAEF,aAAK,UAAU,GAAG;IAChB,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,2BAA2B,CAAC;CACvC,CAAC;AAmCF,wBAAgB,KAAK,CAAC,SAAS,EAAE;IAC/B,qBAAqB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;CACpD,QASA;AAED,wBAAsB,MAAM,CAAC,EAC3B,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,OAAO,GACR,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAelC"}

222
node_modules/jest-runner/build/testWorker.js generated vendored Normal file
View file

@ -0,0 +1,222 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.setup = setup;
exports.worker = worker;
function _jestHasteMap() {
const data = _interopRequireDefault(require('jest-haste-map'));
_jestHasteMap = function _jestHasteMap() {
return data;
};
return data;
}
function _exit() {
const data = _interopRequireDefault(require('exit'));
_exit = function _exit() {
return data;
};
return data;
}
function _jestMessageUtil() {
const data = require('jest-message-util');
_jestMessageUtil = function _jestMessageUtil() {
return data;
};
return data;
}
function _jestRuntime() {
const data = _interopRequireDefault(require('jest-runtime'));
_jestRuntime = function _jestRuntime() {
return data;
};
return data;
}
var _runTest = _interopRequireDefault(require('./runTest'));
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);
});
};
}
// Make sure uncaught errors are logged before we exit.
process.on('uncaughtException', err => {
console.error(err.stack);
(0, _exit().default)(1);
});
const formatError = error => {
if (typeof error === 'string') {
const _separateMessageFromS = (0,
_jestMessageUtil().separateMessageFromStack)(error),
message = _separateMessageFromS.message,
stack = _separateMessageFromS.stack;
return {
message,
stack,
type: 'Error'
};
}
return {
code: error.code || undefined,
message: error.message,
stack: error.stack,
type: 'Error'
};
};
const resolvers = new Map();
const getResolver = config => {
const resolver = resolvers.get(config.name);
if (!resolver) {
throw new Error('Cannot find resolver for: ' + config.name);
}
return resolver;
};
function setup(setupData) {
// Module maps that will be needed for the test runs are passed.
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (
var _iterator = setupData.serializableResolvers[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
_iteratorNormalCompletion = true
) {
const _step$value = _step.value,
config = _step$value.config,
serializableModuleMap = _step$value.serializableModuleMap;
const moduleMap = _jestHasteMap().default.ModuleMap.fromJSON(
serializableModuleMap
);
resolvers.set(
config.name,
_jestRuntime().default.createResolver(config, moduleMap)
);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
function worker(_x) {
return _worker.apply(this, arguments);
}
function _worker() {
_worker = _asyncToGenerator(function*({config, globalConfig, path, context}) {
try {
return yield (0, _runTest.default)(
path,
globalConfig,
config,
getResolver(config),
context &&
_objectSpread({}, context, {
changedFiles: context.changedFiles && new Set(context.changedFiles)
})
);
} catch (error) {
throw formatError(error);
}
});
return _worker.apply(this, arguments);
}

54
node_modules/jest-runner/build/types.d.ts generated vendored Normal file
View file

@ -0,0 +1,54 @@
/**
* 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';
import { Config } from '@jest/types';
import { SerializableError, TestResult } from '@jest/test-result';
import { JestEnvironment } from '@jest/environment';
import { ModuleMap, FS as HasteFS } from 'jest-haste-map';
import HasteResolver from 'jest-resolve';
import Runtime from 'jest-runtime';
export declare type ErrorWithCode = Error & {
code?: string;
};
export declare type Test = {
context: Context;
duration?: number;
path: Config.Path;
};
export declare type Context = {
config: Config.ProjectConfig;
hasteFS: HasteFS;
moduleMap: ModuleMap;
resolver: HasteResolver;
};
export declare type OnTestStart = (test: Test) => Promise<void>;
export declare type OnTestFailure = (test: Test, serializableError: SerializableError) => Promise<void>;
export declare type OnTestSuccess = (test: Test, testResult: TestResult) => Promise<void>;
export declare type TestFramework = (globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, environment: JestEnvironment, runtime: Runtime, testPath: string) => Promise<TestResult>;
export declare type TestRunnerOptions = {
serial: boolean;
};
export declare type TestRunnerContext = {
changedFiles?: Set<Config.Path>;
};
export declare type TestRunnerSerializedContext = {
changedFiles?: Array<Config.Path>;
};
export declare type WatcherState = {
interrupted: boolean;
};
export interface TestWatcher extends EventEmitter {
state: WatcherState;
new ({ isWatchMode }: {
isWatchMode: boolean;
}): TestWatcher;
setState(state: WatcherState): void;
isInterrupted(): boolean;
isWatchMode(): boolean;
}
//# sourceMappingURL=types.d.ts.map

1
node_modules/jest-runner/build/types.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,iBAAiB,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAE,EAAE,IAAI,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACxD,OAAO,aAAa,MAAM,cAAc,CAAC;AACzC,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,oBAAY,aAAa,GAAG,KAAK,GAAG;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AACpD,oBAAY,IAAI,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;CACnB,CAAC;AAEF,oBAAY,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,oBAAY,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AACxD,oBAAY,aAAa,GAAG,CAC1B,IAAI,EAAE,IAAI,EACV,iBAAiB,EAAE,iBAAiB,KACjC,OAAO,CAAC,IAAI,CAAC,CAAC;AACnB,oBAAY,aAAa,GAAG,CAC1B,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,KACnB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,oBAAY,aAAa,GAAG,CAC1B,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,MAAM,EAAE,MAAM,CAAC,aAAa,EAC5B,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,UAAU,CAAC,CAAC;AAEzB,oBAAY,iBAAiB,GAAG;IAC9B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC;AAEF,oBAAY,2BAA2B,GAAG;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACnC,CAAC;AAGF,oBAAY,YAAY,GAAG;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AACF,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAC,WAAW,EAAC,EAAE;QAAC,WAAW,EAAE,OAAO,CAAA;KAAC,GAAG,WAAW,CAAC;IACzD,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC,aAAa,IAAI,OAAO,CAAC;IACzB,WAAW,IAAI,OAAO,CAAC;CACxB"}

1
node_modules/jest-runner/build/types.js generated vendored Normal file
View file

@ -0,0 +1 @@
'use strict';

49
node_modules/jest-runner/package.json generated vendored Normal file
View file

@ -0,0 +1,49 @@
{
"name": "jest-runner",
"version": "24.8.0",
"repository": {
"type": "git",
"url": "https://github.com/facebook/jest.git",
"directory": "packages/jest-runner"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"dependencies": {
"@jest/console": "^24.7.1",
"@jest/environment": "^24.8.0",
"@jest/test-result": "^24.8.0",
"@jest/types": "^24.8.0",
"chalk": "^2.4.2",
"exit": "^0.1.2",
"graceful-fs": "^4.1.15",
"jest-config": "^24.8.0",
"jest-docblock": "^24.3.0",
"jest-haste-map": "^24.8.0",
"jest-jasmine2": "^24.8.0",
"jest-leak-detector": "^24.8.0",
"jest-message-util": "^24.8.0",
"jest-resolve": "^24.8.0",
"jest-runtime": "^24.8.0",
"jest-util": "^24.8.0",
"jest-worker": "^24.6.0",
"source-map-support": "^0.5.6",
"throat": "^4.0.0"
},
"devDependencies": {
"@types/exit": "^0.1.30",
"@types/graceful-fs": "^4.1.2",
"@types/source-map-support": "^0.5.0"
},
"engines": {
"node": ">= 6"
},
"publishConfig": {
"access": "public"
},
"gitHead": "845728f24b3ef41e450595c384e9b5c9fdf248a4"
,"_resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.8.0.tgz"
,"_integrity": "sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow=="
,"_from": "jest-runner@24.8.0"
}

22
node_modules/jest-runner/tsconfig.json generated vendored Normal file
View file

@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
},
"references": [
{"path": "../jest-config"},
{"path": "../jest-console"},
{"path": "../jest-docblock"},
{"path": "../jest-environment"},
{"path": "../jest-haste-map"},
{"path": "../jest-leak-detector"},
{"path": "../jest-message-util"},
{"path": "../jest-resolve"},
{"path": "../jest-runtime"},
{"path": "../jest-test-result"},
{"path": "../jest-types"},
{"path": "../jest-worker"},
{"path": "../jest-util"}
]
}