Add node modules and new code for release

This commit is contained in:
tbarnes94 2022-01-05 16:22:49 +00:00 committed by GitHub
parent a10d84bc2e
commit 90f63cb10d
7655 changed files with 1763577 additions and 14 deletions

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 type { Config } from '@jest/types';
declare const activeFilters: (globalConfig: Config.GlobalConfig, delimiter?: string) => string;
export default activeFilters;

View file

@ -0,0 +1,54 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const activeFilters = (globalConfig, delimiter = '\n') => {
const {testNamePattern, testPathPattern} = globalConfig;
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;

11
node_modules/@jest/core/build/lib/create_context.d.ts generated vendored Normal file
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 type { Config } from '@jest/types';
import Runtime = require('jest-runtime');
import type { HasteMapObject } from 'jest-haste-map';
declare const _default: (config: Config.ProjectConfig, { hasteFS, moduleMap }: HasteMapObject) => Runtime.Context;
export default _default;

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

View file

@ -0,0 +1,73 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _chalk() {
const data = _interopRequireDefault(require('chalk'));
_chalk = function () {
return data;
};
return data;
}
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
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'); // this is a string since we set encoding above
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;

8
node_modules/@jest/core/build/lib/is_valid_path.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.
*/
import type { Config } from '@jest/types';
export default function isValidPath(globalConfig: Config.GlobalConfig, filePath: Config.Path): boolean;

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

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; // if the output here changes, update `getConfig` in e2e/runJest.ts
function logDebugMessages(globalConfig, configs, outputStream) {
const output = {
configs,
globalConfig,
version: VERSION
};
outputStream.write(JSON.stringify(output, null, ' ') + '\n');
}

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 type { Config } from '@jest/types';
import type { AllowedConfigOptions } from 'jest-watcher';
declare type ExtraConfigOptions = Partial<Pick<Config.GlobalConfig, 'noSCM' | 'passWithNoTests'>>;
declare const _default: (globalConfig: Config.GlobalConfig, options?: AllowedConfigOptions & ExtraConfigOptions) => Config.GlobalConfig;
export default _default;

View file

@ -0,0 +1,116 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestRegexUtil() {
const data = require('jest-regex-util');
_jestRegexUtil = function () {
return data;
};
return data;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var _default = (globalConfig, options = {}) => {
const newConfig = {...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,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { Config } from '@jest/types';
import type { UsageData, WatchPlugin } from 'jest-watcher';
export declare const filterInteractivePlugins: (watchPlugins: Array<WatchPlugin>, globalConfig: Config.GlobalConfig) => Array<WatchPlugin>;
export declare const getSortedUsageRows: (watchPlugins: Array<WatchPlugin>, globalConfig: Config.GlobalConfig) => Array<UsageData>;

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;
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;