Add node modules and new code for release (#39)
Co-authored-by: tbarnes94 <tbarnes94@users.noreply.github.com>
This commit is contained in:
parent
a10d84bc2e
commit
7ad2aa66bb
7655 changed files with 1763577 additions and 14 deletions
9
node_modules/jest-runtime/build/cli/args.d.ts
generated
vendored
Normal file
9
node_modules/jest-runtime/build/cli/args.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import type { Options } from 'yargs';
|
||||
export declare const usage = "Usage: $0 [--config=<pathToConfigFile>] <file>";
|
||||
export declare const options: Record<'cache' | 'config' | 'debug' | 'version' | 'watchman', Options>;
|
46
node_modules/jest-runtime/build/cli/args.js
generated
vendored
Normal file
46
node_modules/jest-runtime/build/cli/args.js
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.options = exports.usage = 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 usage = 'Usage: $0 [--config=<pathToConfigFile>] <file>';
|
||||
exports.usage = usage;
|
||||
const options = {
|
||||
cache: {
|
||||
default: true,
|
||||
description:
|
||||
'Whether to use the preprocessor cache. Disable ' +
|
||||
'the cache using --no-cache.',
|
||||
type: 'boolean'
|
||||
},
|
||||
config: {
|
||||
alias: 'c',
|
||||
description: 'The path to a Jest config file.',
|
||||
type: 'string'
|
||||
},
|
||||
debug: {
|
||||
description: 'Print debugging info about your jest config.',
|
||||
type: 'boolean'
|
||||
},
|
||||
version: {
|
||||
alias: 'v',
|
||||
description: 'Print the version and exit',
|
||||
type: 'boolean'
|
||||
},
|
||||
watchman: {
|
||||
default: true,
|
||||
description:
|
||||
'Whether to use watchman for file crawling. Disable using ' +
|
||||
'--no-watchman.',
|
||||
type: 'boolean'
|
||||
}
|
||||
};
|
||||
exports.options = options;
|
8
node_modules/jest-runtime/build/cli/index.d.ts
generated
vendored
Normal file
8
node_modules/jest-runtime/build/cli/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import type { Config } from '@jest/types';
|
||||
export declare function run(cliArgv?: Config.Argv, cliInfo?: Array<string>): Promise<void>;
|
258
node_modules/jest-runtime/build/cli/index.js
generated
vendored
Normal file
258
node_modules/jest-runtime/build/cli/index.js
generated
vendored
Normal file
|
@ -0,0 +1,258 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.run = run;
|
||||
|
||||
function _os() {
|
||||
const data = require('os');
|
||||
|
||||
_os = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _yargs() {
|
||||
const data = _interopRequireDefault(require('yargs'));
|
||||
|
||||
_yargs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _console() {
|
||||
const data = require('@jest/console');
|
||||
|
||||
_console = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestValidate() {
|
||||
const data = require('jest-validate');
|
||||
|
||||
_jestValidate = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestConfig() {
|
||||
const data = require('jest-config');
|
||||
|
||||
_jestConfig = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _version() {
|
||||
const data = require('../version');
|
||||
|
||||
_version = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var args = _interopRequireWildcard(require('./args'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function () {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
async function run(cliArgv, cliInfo) {
|
||||
let argv;
|
||||
|
||||
if (cliArgv) {
|
||||
argv = cliArgv;
|
||||
} else {
|
||||
argv = _yargs()
|
||||
.default.usage(args.usage)
|
||||
.help(false)
|
||||
.version(false)
|
||||
.options(args.options).argv;
|
||||
(0, _jestValidate().validateCLIOptions)(argv, {
|
||||
...args.options,
|
||||
deprecationEntries: _jestConfig().deprecationEntries
|
||||
});
|
||||
}
|
||||
|
||||
if (argv.help) {
|
||||
_yargs().default.showHelp();
|
||||
|
||||
process.on('exit', () => (process.exitCode = 1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (argv.version) {
|
||||
console.log(`v${_version().VERSION}\n`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!argv._.length) {
|
||||
console.log('Please provide a path to a script. (See --help for details)');
|
||||
process.on('exit', () => (process.exitCode = 1));
|
||||
return;
|
||||
}
|
||||
|
||||
const root = (0, _jestUtil().tryRealpath)(process.cwd());
|
||||
const filePath = path().resolve(root, argv._[0]);
|
||||
|
||||
if (argv.debug) {
|
||||
const info = cliInfo ? ', ' + cliInfo.join(', ') : '';
|
||||
console.log(`Using Jest Runtime v${_version().VERSION}${info}`);
|
||||
}
|
||||
|
||||
const options = await (0, _jestConfig().readConfig)(argv, root);
|
||||
const globalConfig = options.globalConfig; // Always disable automocking in scripts.
|
||||
|
||||
const config = {...options.projectConfig, automock: false}; // Break circular dependency
|
||||
|
||||
const Runtime = require('..');
|
||||
|
||||
try {
|
||||
var _runtime$unstable_sho2;
|
||||
|
||||
const hasteMap = await Runtime.createContext(config, {
|
||||
maxWorkers: Math.max((0, _os().cpus)().length - 1, 1),
|
||||
watchman: globalConfig.watchman
|
||||
});
|
||||
|
||||
const Environment = require(config.testEnvironment);
|
||||
|
||||
const environment = new Environment(config);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
environment.global,
|
||||
'console',
|
||||
new (_console().CustomConsole)(process.stdout, process.stderr)
|
||||
);
|
||||
(0, _jestUtil().setGlobal)(environment.global, 'jestProjectConfig', config);
|
||||
(0, _jestUtil().setGlobal)(
|
||||
environment.global,
|
||||
'jestGlobalConfig',
|
||||
globalConfig
|
||||
);
|
||||
const runtime = new Runtime(config, environment, hasteMap.resolver);
|
||||
|
||||
for (const path of config.setupFiles) {
|
||||
var _runtime$unstable_sho;
|
||||
|
||||
// TODO: remove ? in Jest 26
|
||||
const esm =
|
||||
(_runtime$unstable_sho = runtime.unstable_shouldLoadAsEsm) === null ||
|
||||
_runtime$unstable_sho === void 0
|
||||
? void 0
|
||||
: _runtime$unstable_sho.call(runtime, path);
|
||||
|
||||
if (esm) {
|
||||
await runtime.unstable_importModule(path);
|
||||
} else {
|
||||
runtime.requireModule(path);
|
||||
}
|
||||
} // TODO: remove ? in Jest 26
|
||||
|
||||
const esm =
|
||||
(_runtime$unstable_sho2 = runtime.unstable_shouldLoadAsEsm) === null ||
|
||||
_runtime$unstable_sho2 === void 0
|
||||
? void 0
|
||||
: _runtime$unstable_sho2.call(runtime, filePath);
|
||||
|
||||
if (esm) {
|
||||
await runtime.unstable_importModule(filePath);
|
||||
} else {
|
||||
runtime.requireModule(filePath);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(_chalk().default.red(e.stack || e));
|
||||
process.on('exit', () => (process.exitCode = 1));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue