mirror of https://github.com/facebook/jest.git
Stop using `import X = require('…')`. (#15659)
This commit is contained in:
parent
8fcefef178
commit
a2218e4f79
|
@ -16,11 +16,6 @@ module.exports = {
|
||||||
exclude: /react-native/,
|
exclude: /react-native/,
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
plugins: [
|
|
||||||
require.resolve(
|
|
||||||
'./scripts/babel-plugin-jest-replace-ts-require-assignment.js',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'@babel/preset-typescript',
|
'@babel/preset-typescript',
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
sync as spawnSync,
|
sync as spawnSync,
|
||||||
} from 'execa';
|
} from 'execa';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import which = require('which');
|
import which from 'which';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
|
||||||
const dedent = dedentBase.withOptions({escapeSpecialCharacters: true});
|
const dedent = dedentBase.withOptions({escapeSpecialCharacters: true});
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import {tmpdir} from 'os';
|
import {tmpdir} from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import semver = require('semver');
|
import * as semver from 'semver';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import {findRepos, getChangedFilesForRoots} from 'jest-changed-files';
|
import {findRepos, getChangedFilesForRoots} from 'jest-changed-files';
|
||||||
import {
|
import {
|
||||||
cleanup,
|
cleanup,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import runJest from '../runJest';
|
import runJest from '../runJest';
|
||||||
|
|
||||||
const MULTIPLE_CONFIGS_WARNING_TEXT = 'Multiple configurations found';
|
const MULTIPLE_CONFIGS_WARNING_TEXT = 'Multiple configurations found';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import {tmpdir} from 'os';
|
import {tmpdir} from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import semver = require('semver');
|
import * as semver from 'semver';
|
||||||
import {cleanup, run, testIfHg, testIfSl, writeFiles} from '../Utils';
|
import {cleanup, run, testIfHg, testIfSl, writeFiles} from '../Utils';
|
||||||
import runJest from '../runJest';
|
import runJest from '../runJest';
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
* This source code is licensed under the MIT license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import execa = require('execa');
|
import execa from 'execa';
|
||||||
import {onNodeVersions} from '@jest/test-utils';
|
import {onNodeVersions} from '@jest/test-utils';
|
||||||
import type {ReadJestConfigOptions, readInitialOptions} from 'jest-config';
|
import type {ReadJestConfigOptions, readInitialOptions} from 'jest-config';
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import {tmpdir} from 'os';
|
import {tmpdir} from 'os';
|
||||||
import {resolve} from 'path';
|
import {resolve} from 'path';
|
||||||
import findProcess = require('find-process');
|
import findProcess from 'find-process';
|
||||||
import {
|
import {
|
||||||
cleanup,
|
cleanup,
|
||||||
generateTestFilesToForceUsingWorkers,
|
generateTestFilesToForceUsingWorkers,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import * as path from 'path';
|
||||||
import {Writable} from 'stream';
|
import {Writable} from 'stream';
|
||||||
import {stripVTControlCharacters as stripAnsi} from 'util';
|
import {stripVTControlCharacters as stripAnsi} from 'util';
|
||||||
import dedent from 'dedent';
|
import dedent from 'dedent';
|
||||||
import execa = require('execa');
|
import execa from 'execa';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import {TestPathPatterns} from '@jest/pattern';
|
import {TestPathPatterns} from '@jest/pattern';
|
||||||
import type {FormattedTestResults} from '@jest/test-result';
|
import type {FormattedTestResults} from '@jest/test-result';
|
||||||
|
|
|
@ -13,9 +13,9 @@ import {
|
||||||
transformSync as babelTransform,
|
transformSync as babelTransform,
|
||||||
transformAsync as babelTransformAsync,
|
transformAsync as babelTransformAsync,
|
||||||
} from '@babel/core';
|
} from '@babel/core';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import type {
|
import type {
|
||||||
TransformOptions as JestTransformOptions,
|
TransformOptions as JestTransformOptions,
|
||||||
SyncTransformer,
|
SyncTransformer,
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import prompts = require('prompts');
|
import prompts from 'prompts';
|
||||||
import {constants} from 'jest-config';
|
import {constants} from 'jest-config';
|
||||||
import {clearLine, tryRealpath} from 'jest-util';
|
import {clearLine, tryRealpath} from 'jest-util';
|
||||||
import {MalformedPackageJsonError, NotFoundPackageJsonError} from './errors';
|
import {MalformedPackageJsonError, NotFoundPackageJsonError} from './errors';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import execa = require('execa');
|
import execa from 'execa';
|
||||||
import type {SCMAdapter} from './types';
|
import type {SCMAdapter} from './types';
|
||||||
|
|
||||||
const findChangedFilesUsingCommand = async (
|
const findChangedFilesUsingCommand = async (
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import execa = require('execa');
|
import execa from 'execa';
|
||||||
import type {SCMAdapter} from './types';
|
import type {SCMAdapter} from './types';
|
||||||
|
|
||||||
const env = {...process.env, HGPLAIN: '1'};
|
const env = {...process.env, HGPLAIN: '1'};
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import pLimit = require('p-limit');
|
import pLimit from 'p-limit';
|
||||||
import {isNonNullable} from 'jest-util';
|
import {isNonNullable} from 'jest-util';
|
||||||
import git from './git';
|
import git from './git';
|
||||||
import hg from './hg';
|
import hg from './hg';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import execa = require('execa');
|
import execa from 'execa';
|
||||||
import type {SCMAdapter} from './types';
|
import type {SCMAdapter} from './types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import {sync as spawnSync} from 'execa';
|
import {sync as spawnSync} from 'execa';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import tempy = require('tempy');
|
import tempy from 'tempy';
|
||||||
|
|
||||||
const CIRCUS_PATH = require.resolve('../').replaceAll('\\', '\\\\');
|
const CIRCUS_PATH = require.resolve('../').replaceAll('\\', '\\\\');
|
||||||
const CIRCUS_RUN_PATH = require.resolve('../run').replaceAll('\\', '\\\\');
|
const CIRCUS_RUN_PATH = require.resolve('../run').replaceAll('\\', '\\\\');
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {AssertionError} from 'assert';
|
import {AssertionError} from 'assert';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Circus} from '@jest/types';
|
import type {Circus} from '@jest/types';
|
||||||
import {
|
import {
|
||||||
type DiffOptions,
|
type DiffOptions,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {AsyncLocalStorage} from 'async_hooks';
|
import {AsyncLocalStorage} from 'async_hooks';
|
||||||
import pLimit = require('p-limit');
|
import pLimit from 'p-limit';
|
||||||
import {jestExpect} from '@jest/expect';
|
import {jestExpect} from '@jest/expect';
|
||||||
import type {Circus, Global} from '@jest/types';
|
import type {Circus, Global} from '@jest/types';
|
||||||
import {invariant} from 'jest-util';
|
import {invariant} from 'jest-util';
|
||||||
|
|
|
@ -9,8 +9,8 @@ import * as path from 'path';
|
||||||
import co from 'co';
|
import co from 'co';
|
||||||
import dedent from 'dedent';
|
import dedent from 'dedent';
|
||||||
import isGeneratorFn from 'is-generator-fn';
|
import isGeneratorFn from 'is-generator-fn';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import StackUtils = require('stack-utils');
|
import StackUtils from 'stack-utils';
|
||||||
import type {Status, TestCaseResult} from '@jest/test-result';
|
import type {Status, TestCaseResult} from '@jest/test-result';
|
||||||
import type {Circus, Global} from '@jest/types';
|
import type {Circus, Global} from '@jest/types';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import yargs = require('yargs');
|
import yargs from 'yargs';
|
||||||
import {getVersion, runCLI} from '@jest/core';
|
import {getVersion, runCLI} from '@jest/core';
|
||||||
import type {AggregatedResult} from '@jest/test-result';
|
import type {AggregatedResult} from '@jest/test-result';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {DeprecatedOptions} from 'jest-validate';
|
import type {DeprecatedOptions} from 'jest-validate';
|
||||||
|
|
||||||
function formatDeprecation(message: string): string {
|
function formatDeprecation(message: string): string {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {getType} from '@jest/get-type';
|
import {getType} from '@jest/get-type';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {ValidationError} from 'jest-validate';
|
import {ValidationError} from 'jest-validate';
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
import {createHash} from 'crypto';
|
import {createHash} from 'crypto';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import semver = require('semver');
|
import * as semver from 'semver';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {escapeStrForRegex} from 'jest-regex-util';
|
import {escapeStrForRegex} from 'jest-regex-util';
|
||||||
import Defaults from '../Defaults';
|
import Defaults from '../Defaults';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import path = require('path');
|
import path from 'path';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import {requireOrImportModule} from 'jest-util';
|
import {requireOrImportModule} from 'jest-util';
|
||||||
import readConfigFileAndSetRootDir from '../readConfigFileAndSetRootDir';
|
import readConfigFileAndSetRootDir from '../readConfigFileAndSetRootDir';
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {tryRealpath} from 'jest-util';
|
import {tryRealpath} from 'jest-util';
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
import {createHash} from 'crypto';
|
import {createHash} from 'crypto';
|
||||||
import {totalmem} from 'os';
|
import {totalmem} from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import merge = require('deepmerge');
|
import merge from 'deepmerge';
|
||||||
import {glob} from 'glob';
|
import {glob} from 'glob';
|
||||||
import {statSync} from 'graceful-fs';
|
import {statSync} from 'graceful-fs';
|
||||||
import micromatch = require('micromatch');
|
import micromatch from 'micromatch';
|
||||||
import {TestPathPatterns} from '@jest/pattern';
|
import {TestPathPatterns} from '@jest/pattern';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {replacePathSepForRegex} from 'jest-regex-util';
|
import {replacePathSepForRegex} from 'jest-regex-util';
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {isNativeError} from 'util/types';
|
import {isNativeError} from 'util/types';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import parseJson = require('parse-json');
|
import parseJson from 'parse-json';
|
||||||
import stripJsonComments = require('strip-json-comments');
|
import stripJsonComments from 'strip-json-comments';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {extract, parse} from 'jest-docblock';
|
import {extract, parse} from 'jest-docblock';
|
||||||
import {interopRequireDefault, requireOrImportModule} from 'jest-util';
|
import {interopRequireDefault, requireOrImportModule} from 'jest-util';
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import {ValidationError} from 'jest-validate';
|
import {ValidationError} from 'jest-validate';
|
||||||
import {
|
import {
|
||||||
JEST_CONFIG_BASE_NAME,
|
JEST_CONFIG_BASE_NAME,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import Resolver from 'jest-resolve';
|
import Resolver from 'jest-resolve';
|
||||||
import {ValidationError} from 'jest-validate';
|
import {ValidationError} from 'jest-validate';
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
import {AssertionError, strict as assert} from 'assert';
|
import {AssertionError, strict as assert} from 'assert';
|
||||||
import {Console} from 'console';
|
import {Console} from 'console';
|
||||||
import {type InspectOptions, format, formatWithOptions, inspect} from 'util';
|
import {type InspectOptions, format, formatWithOptions, inspect} from 'util';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {ErrorWithStack, formatTime, invariant} from 'jest-util';
|
import {ErrorWithStack, formatTime, invariant} from 'jest-util';
|
||||||
import type {
|
import type {
|
||||||
ConsoleBuffer,
|
ConsoleBuffer,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {AssertionError, strict as assert} from 'assert';
|
||||||
import {Console} from 'console';
|
import {Console} from 'console';
|
||||||
import type {WriteStream} from 'tty';
|
import type {WriteStream} from 'tty';
|
||||||
import {type InspectOptions, format, formatWithOptions, inspect} from 'util';
|
import {type InspectOptions, format, formatWithOptions, inspect} from 'util';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {clearLine, formatTime} from 'jest-util';
|
import {clearLine, formatTime} from 'jest-util';
|
||||||
import type {LogCounters, LogMessage, LogTimers, LogType} from './types';
|
import type {LogCounters, LogMessage, LogTimers, LogType} from './types';
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import {Writable} from 'stream';
|
import {Writable} from 'stream';
|
||||||
import type {WriteStream} from 'tty';
|
import type {WriteStream} from 'tty';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import CustomConsole from '../CustomConsole';
|
import CustomConsole from '../CustomConsole';
|
||||||
|
|
||||||
describe('CustomConsole', () => {
|
describe('CustomConsole', () => {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import BufferedConsole from '../BufferedConsole';
|
import BufferedConsole from '../BufferedConsole';
|
||||||
|
|
||||||
describe('CustomConsole', () => {
|
describe('CustomConsole', () => {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {
|
import {
|
||||||
type StackTraceConfig,
|
type StackTraceConfig,
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import ansiEscapes = require('ansi-escapes');
|
import ansiEscapes from 'ansi-escapes';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {AggregatedResult, AssertionLocation} from '@jest/test-result';
|
import type {AggregatedResult, AssertionLocation} from '@jest/test-result';
|
||||||
import {pluralize, specialChars} from 'jest-util';
|
import {pluralize, specialChars} from 'jest-util';
|
||||||
import {KEYS} from 'jest-watcher';
|
import {KEYS} from 'jest-watcher';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import micromatch = require('micromatch');
|
import micromatch from 'micromatch';
|
||||||
import type {TestPathPatternsExecutor} from '@jest/pattern';
|
import type {TestPathPatternsExecutor} from '@jest/pattern';
|
||||||
import type {Test, TestContext} from '@jest/test-result';
|
import type {Test, TestContext} from '@jest/test-result';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import ansiEscapes = require('ansi-escapes');
|
import ansiEscapes from 'ansi-escapes';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {AggregatedResult, AssertionLocation} from '@jest/test-result';
|
import type {AggregatedResult, AssertionLocation} from '@jest/test-result';
|
||||||
import {pluralize, specialChars} from 'jest-util';
|
import {pluralize, specialChars} from 'jest-util';
|
||||||
import {KEYS} from 'jest-watcher';
|
import {KEYS} from 'jest-watcher';
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {GITHUB_ACTIONS} from 'ci-info';
|
import {GITHUB_ACTIONS} from 'ci-info';
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import {
|
import {
|
||||||
CoverageReporter,
|
CoverageReporter,
|
||||||
DefaultReporter,
|
DefaultReporter,
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
import {performance} from 'perf_hooks';
|
import {performance} from 'perf_hooks';
|
||||||
import type {WriteStream} from 'tty';
|
import type {WriteStream} from 'tty';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import {CustomConsole} from '@jest/console';
|
import {CustomConsole} from '@jest/console';
|
||||||
import type {AggregatedResult, TestContext} from '@jest/test-result';
|
import type {AggregatedResult, TestContext} from '@jest/test-result';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {
|
import {
|
||||||
type ChangedFilesPromise,
|
type ChangedFilesPromise,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {pluralize} from 'jest-util';
|
import {pluralize} from 'jest-util';
|
||||||
import type {TestRunData} from './types';
|
import type {TestRunData} from './types';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {isInteractive} from 'jest-util';
|
import {isInteractive} from 'jest-util';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
|
|
||||||
export default function getNoTestFoundPassWithNoTests(): string {
|
export default function getNoTestFoundPassWithNoTests(): string {
|
||||||
return chalk.bold('No tests found, exiting with code 0');
|
return chalk.bold('No tests found, exiting with code 0');
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {isInteractive} from 'jest-util';
|
import {isInteractive} from 'jest-util';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {pluralize} from 'jest-util';
|
import {pluralize} from 'jest-util';
|
||||||
import type {Stats, TestRunData} from './types';
|
import type {Stats, TestRunData} from './types';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import getProjectDisplayName from './getProjectDisplayName';
|
import getProjectDisplayName from './getProjectDisplayName';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import getProjectDisplayName from './getProjectDisplayName';
|
import getProjectDisplayName from './getProjectDisplayName';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {isNonNullable} from 'jest-util';
|
import {isNonNullable} from 'jest-util';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {ReadStream, WriteStream} from 'tty';
|
import type {ReadStream, WriteStream} from 'tty';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {KEYS} from 'jest-watcher';
|
import {KEYS} from 'jest-watcher';
|
||||||
|
|
||||||
export default function handleDeprecationWarnings(
|
export default function handleDeprecationWarnings(
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {performance} from 'perf_hooks';
|
import {performance} from 'perf_hooks';
|
||||||
import type {WriteStream} from 'tty';
|
import type {WriteStream} from 'tty';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import {CustomConsole} from '@jest/console';
|
import {CustomConsole} from '@jest/console';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import type {WriteStream} from 'tty';
|
import type {WriteStream} from 'tty';
|
||||||
import ansiEscapes = require('ansi-escapes');
|
import ansiEscapes from 'ansi-escapes';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import {TestPathPatterns} from '@jest/pattern';
|
import {TestPathPatterns} from '@jest/pattern';
|
||||||
import type {TestContext} from '@jest/test-result';
|
import type {TestContext} from '@jest/test-result';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
|
|
@ -431,7 +431,7 @@ The `jest-diff` package does not assume that the 2 labels have equal length.
|
||||||
For consistency with most diff tools, you might exchange the colors:
|
For consistency with most diff tools, you might exchange the colors:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
aColor: chalk.red,
|
aColor: chalk.red,
|
||||||
|
@ -444,7 +444,7 @@ const options = {
|
||||||
Although the default inverse of foreground and background colors is hard to beat for changed substrings **within lines**, especially because it highlights spaces, if you want bold font weight on yellow background color:
|
Although the default inverse of foreground and background colors is hard to beat for changed substrings **within lines**, especially because it highlights spaces, if you want bold font weight on yellow background color:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
changeColor: chalk.bold.bgYellowBright,
|
changeColor: chalk.bold.bgYellowBright,
|
||||||
|
@ -534,7 +534,7 @@ A patch mark like `@@ -12,7 +12,9 @@` accounts for omitted common lines.
|
||||||
If you want patch marks to have the same dim color as common lines:
|
If you want patch marks to have the same dim color as common lines:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
expand: false,
|
expand: false,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {stripVTControlCharacters as stripAnsi} from 'util';
|
import {stripVTControlCharacters as stripAnsi} from 'util';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {alignedAnsiStyleSerializer} from '@jest/test-utils';
|
import {alignedAnsiStyleSerializer} from '@jest/test-utils';
|
||||||
import {diff} from '../';
|
import {diff} from '../';
|
||||||
import {NO_DIFF_MESSAGE} from '../constants';
|
import {NO_DIFF_MESSAGE} from '../constants';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {getType} from '@jest/get-type';
|
import {getType} from '@jest/get-type';
|
||||||
import {
|
import {
|
||||||
type PrettyFormatOptions,
|
type PrettyFormatOptions,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {CompareKeys} from 'pretty-format';
|
import type {CompareKeys} from 'pretty-format';
|
||||||
import type {DiffOptions, DiffOptionsNormalized} from './types';
|
import type {DiffOptions, DiffOptionsNormalized} from './types';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {EOL} from 'os';
|
import {EOL} from 'os';
|
||||||
import detectNewline = require('detect-newline');
|
import detectNewline from 'detect-newline';
|
||||||
|
|
||||||
type Pragmas = Record<string, string | Array<string>>;
|
type Pragmas = Record<string, string | Array<string>>;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Global} from '@jest/types';
|
import type {Global} from '@jest/types';
|
||||||
import {format as pretty} from 'pretty-format';
|
import {format as pretty} from 'pretty-format';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import watchman = require('fb-watchman');
|
import * as watchman from 'fb-watchman';
|
||||||
import H from '../constants';
|
import H from '../constants';
|
||||||
import * as fastPath from '../lib/fast_path';
|
import * as fastPath from '../lib/fast_path';
|
||||||
import normalizePathSep from '../lib/normalizePathSep';
|
import normalizePathSep from '../lib/normalizePathSep';
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {EventEmitter} from 'events';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import anymatch, {type Matcher} from 'anymatch';
|
import anymatch, {type Matcher} from 'anymatch';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import micromatch = require('micromatch');
|
import micromatch from 'micromatch';
|
||||||
// @ts-expect-error -- no types
|
// @ts-expect-error -- no types
|
||||||
import walker from 'walker';
|
import walker from 'walker';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {
|
import {
|
||||||
type DiffOptions,
|
type DiffOptions,
|
||||||
diff,
|
diff,
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
import co from 'co';
|
import co from 'co';
|
||||||
import isGeneratorFn from 'is-generator-fn';
|
import isGeneratorFn from 'is-generator-fn';
|
||||||
import pLimit = require('p-limit');
|
import pLimit from 'p-limit';
|
||||||
import type {Config, Global} from '@jest/types';
|
import type {Config, Global} from '@jest/types';
|
||||||
import {isPromise} from 'jest-util';
|
import {isPromise} from 'jest-util';
|
||||||
import isError from './isError';
|
import isError from './isError';
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {alignedAnsiStyleSerializer} from '@jest/test-utils';
|
import {alignedAnsiStyleSerializer} from '@jest/test-utils';
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk, {type Chalk} from 'chalk';
|
||||||
import {getType, isPrimitive} from '@jest/get-type';
|
import {getType, isPrimitive} from '@jest/get-type';
|
||||||
import {
|
import {
|
||||||
DIFF_DELETE,
|
DIFF_DELETE,
|
||||||
|
@ -61,11 +61,11 @@ export type MatcherHintOptions = {
|
||||||
|
|
||||||
export type DiffOptions = ImportDiffOptions;
|
export type DiffOptions = ImportDiffOptions;
|
||||||
|
|
||||||
export const EXPECTED_COLOR = chalk.green;
|
export const EXPECTED_COLOR: Chalk = chalk.green;
|
||||||
export const RECEIVED_COLOR = chalk.red;
|
export const RECEIVED_COLOR: Chalk = chalk.red;
|
||||||
export const INVERTED_COLOR = chalk.inverse;
|
export const INVERTED_COLOR: Chalk = chalk.inverse;
|
||||||
export const BOLD_WEIGHT = chalk.bold;
|
export const BOLD_WEIGHT: Chalk = chalk.bold;
|
||||||
export const DIM_COLOR = chalk.dim;
|
export const DIM_COLOR: Chalk = chalk.dim;
|
||||||
|
|
||||||
const MULTILINE_REGEXP = /\n/;
|
const MULTILINE_REGEXP = /\n/;
|
||||||
const SPACE_SYMBOL = '\u{00B7}'; // middle dot
|
const SPACE_SYMBOL = '\u{00B7}'; // middle dot
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {readFileSync} from 'graceful-fs';
|
import {readFileSync} from 'graceful-fs';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import tempy = require('tempy');
|
import tempy from 'tempy';
|
||||||
import {
|
import {
|
||||||
formatExecError,
|
formatExecError,
|
||||||
formatResultsErrors,
|
formatResultsErrors,
|
||||||
|
|
|
@ -9,11 +9,11 @@ import * as path from 'path';
|
||||||
import {fileURLToPath} from 'url';
|
import {fileURLToPath} from 'url';
|
||||||
import {types} from 'util';
|
import {types} from 'util';
|
||||||
import {codeFrameColumns} from '@babel/code-frame';
|
import {codeFrameColumns} from '@babel/code-frame';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import micromatch = require('micromatch');
|
import micromatch from 'micromatch';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import StackUtils = require('stack-utils');
|
import StackUtils from 'stack-utils';
|
||||||
import type {Config, TestResult} from '@jest/types';
|
import type {Config, TestResult} from '@jest/types';
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
import type {Frame} from './types';
|
import type {Frame} from './types';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import yargs = require('yargs');
|
import yargs from 'yargs';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {deprecationEntries} from 'jest-config';
|
import {deprecationEntries} from 'jest-config';
|
||||||
import {validateCLIOptions} from 'jest-validate';
|
import {validateCLIOptions} from 'jest-validate';
|
||||||
|
@ -17,9 +17,10 @@ import {VERSION} from './version';
|
||||||
|
|
||||||
const REPL_SCRIPT = require.resolve('./repl');
|
const REPL_SCRIPT = require.resolve('./repl');
|
||||||
|
|
||||||
export function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
const argv = yargs.usage(args.usage).options(args.options)
|
const argv = (await yargs(process.argv.slice(2))
|
||||||
.argv as Config.Argv;
|
.usage(args.usage)
|
||||||
|
.options(args.options).argv) as Config.Argv;
|
||||||
|
|
||||||
validateCLIOptions(argv, {...args.options, deprecationEntries});
|
validateCLIOptions(argv, {...args.options, deprecationEntries});
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import {availableParallelism} from 'os';
|
import {availableParallelism} from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as util from 'util';
|
import * as util from 'util';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import yargs = require('yargs');
|
import yargs from 'yargs';
|
||||||
import {CustomConsole} from '@jest/console';
|
import {CustomConsole} from '@jest/console';
|
||||||
import type {JestEnvironment} from '@jest/environment';
|
import type {JestEnvironment} from '@jest/environment';
|
||||||
import {createScriptTransformer} from '@jest/transform';
|
import {createScriptTransformer} from '@jest/transform';
|
||||||
|
@ -29,17 +29,17 @@ export async function run(
|
||||||
if (cliArgv) {
|
if (cliArgv) {
|
||||||
argv = cliArgv;
|
argv = cliArgv;
|
||||||
} else {
|
} else {
|
||||||
argv = yargs
|
argv = (await yargs(process.argv.slice(2))
|
||||||
.usage(args.usage)
|
.usage(args.usage)
|
||||||
.help(false)
|
.help(false)
|
||||||
.version(false)
|
.version(false)
|
||||||
.options(args.options).argv as Config.Argv;
|
.options(args.options).argv) as Config.Argv;
|
||||||
|
|
||||||
validateCLIOptions(argv, {...args.options, deprecationEntries});
|
validateCLIOptions(argv, {...args.options, deprecationEntries});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argv.help === true) {
|
if (argv.help === true) {
|
||||||
yargs.showHelp();
|
yargs().showHelp();
|
||||||
process.on('exit', () => (process.exitCode = 1));
|
process.on('exit', () => (process.exitCode = 1));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,14 +8,16 @@
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {mergeProcessCovs} from '@bcoe/v8-coverage';
|
import {mergeProcessCovs} from '@bcoe/v8-coverage';
|
||||||
import type {EncodedSourceMap} from '@jridgewell/trace-mapping';
|
import type {EncodedSourceMap} from '@jridgewell/trace-mapping';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {glob} from 'glob';
|
import {glob} from 'glob';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import istanbulCoverage = require('istanbul-lib-coverage');
|
/* eslint-disable import-x/default */
|
||||||
import istanbulReport = require('istanbul-lib-report');
|
import istanbulCoverage from 'istanbul-lib-coverage';
|
||||||
import libSourceMaps = require('istanbul-lib-source-maps');
|
import istanbulReport from 'istanbul-lib-report';
|
||||||
import istanbulReports = require('istanbul-reports');
|
import libSourceMaps from 'istanbul-lib-source-maps';
|
||||||
import v8toIstanbul = require('v8-to-istanbul');
|
import istanbulReports from 'istanbul-reports';
|
||||||
|
/* eslint-enable import-x/default */
|
||||||
|
import v8toIstanbul from 'v8-to-istanbul';
|
||||||
import type {
|
import type {
|
||||||
AggregatedResult,
|
AggregatedResult,
|
||||||
RuntimeTransformResult,
|
RuntimeTransformResult,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import generateEmptyCoverage, {
|
import generateEmptyCoverage, {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {WriteStream} from 'tty';
|
import type {WriteStream} from 'tty';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {getConsoleOutput} from '@jest/console';
|
import {getConsoleOutput} from '@jest/console';
|
||||||
import type {
|
import type {
|
||||||
AggregatedResult,
|
AggregatedResult,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {stripVTControlCharacters as stripAnsi} from 'util';
|
import {stripVTControlCharacters as stripAnsi} from 'util';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {
|
import type {
|
||||||
AggregatedResult,
|
AggregatedResult,
|
||||||
AssertionResult,
|
AssertionResult,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as util from 'util';
|
import * as util from 'util';
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import type {AggregatedResult, TestContext} from '@jest/test-result';
|
import type {AggregatedResult, TestContext} from '@jest/test-result';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {pluralize} from 'jest-util';
|
import {pluralize} from 'jest-util';
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import stringLength = require('string-length');
|
import stringLength from 'string-length';
|
||||||
import type {
|
import type {
|
||||||
AggregatedResult,
|
AggregatedResult,
|
||||||
Test,
|
Test,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {
|
import type {
|
||||||
AggregatedResult,
|
AggregatedResult,
|
||||||
SnapshotSummary,
|
SnapshotSummary,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {WriteStream} from 'tty';
|
import type {WriteStream} from 'tty';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {
|
import type {
|
||||||
AggregatedResult,
|
AggregatedResult,
|
||||||
AssertionResult,
|
AssertionResult,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {stripVTControlCharacters as stripAnsi} from 'util';
|
import {stripVTControlCharacters as stripAnsi} from 'util';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {makeProjectConfig} from '@jest/test-utils';
|
import {makeProjectConfig} from '@jest/test-utils';
|
||||||
import printDisplayName from '../printDisplayName';
|
import printDisplayName from '../printDisplayName';
|
||||||
import trimAndFormatPath from '../trimAndFormatPath';
|
import trimAndFormatPath from '../trimAndFormatPath';
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import relativePath from './relativePath';
|
import relativePath from './relativePath';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {TestResult} from '@jest/test-result';
|
import type {TestResult} from '@jest/test-result';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {formatTime} from 'jest-util';
|
import {formatTime} from 'jest-util';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {TestResult} from '@jest/test-result';
|
import type {TestResult} from '@jest/test-result';
|
||||||
import {pluralize} from 'jest-util';
|
import {pluralize} from 'jest-util';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {SnapshotSummary} from '@jest/test-result';
|
import type {SnapshotSummary} from '@jest/test-result';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {pluralize} from 'jest-util';
|
import {pluralize} from 'jest-util';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {AggregatedResult, Test, TestCaseResult} from '@jest/test-result';
|
import type {AggregatedResult, Test, TestCaseResult} from '@jest/test-result';
|
||||||
import {formatTime, pluralize} from 'jest-util';
|
import {formatTime, pluralize} from 'jest-util';
|
||||||
import type {SummaryOptions} from './types';
|
import type {SummaryOptions} from './types';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import istanbulReport = require('istanbul-lib-report');
|
import * as istanbulReport from 'istanbul-lib-report';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
|
||||||
export default function getWatermarks(
|
export default function getWatermarks(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
|
||||||
export default function printDisplayName(config: Config.ProjectConfig): string {
|
export default function printDisplayName(config: Config.ProjectConfig): string {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import relativePath from './relativePath';
|
import relativePath from './relativePath';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
|
|
||||||
export default class ModuleNotFoundError extends Error {
|
export default class ModuleNotFoundError extends Error {
|
||||||
public code = 'MODULE_NOT_FOUND';
|
public code = 'MODULE_NOT_FOUND';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import module = require('module');
|
import module from 'module';
|
||||||
|
|
||||||
const BUILTIN_MODULES = new Set(module.builtinModules);
|
const BUILTIN_MODULES = new Set(module.builtinModules);
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import type {IModuleMap} from 'jest-haste-map';
|
import type {IModuleMap} from 'jest-haste-map';
|
||||||
import {tryRealpath} from 'jest-util';
|
import {tryRealpath} from 'jest-util';
|
||||||
import ModuleNotFoundError from './ModuleNotFoundError';
|
import ModuleNotFoundError from './ModuleNotFoundError';
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {ValidationError} from 'jest-validate';
|
import {ValidationError} from 'jest-validate';
|
||||||
import Resolver from './resolver';
|
import Resolver from './resolver';
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"emittery": "^0.13.1",
|
"emittery": "^0.13.1",
|
||||||
|
"exit-x": "^0.2.2",
|
||||||
"graceful-fs": "^4.2.11",
|
"graceful-fs": "^4.2.11",
|
||||||
"jest-docblock": "workspace:*",
|
"jest-docblock": "workspace:*",
|
||||||
"jest-environment-node": "workspace:*",
|
"jest-environment-node": "workspace:*",
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import Emittery = require('emittery');
|
import Emittery from 'emittery';
|
||||||
import pLimit = require('p-limit');
|
import pLimit from 'p-limit';
|
||||||
import type {
|
import type {
|
||||||
Test,
|
Test,
|
||||||
TestEvents,
|
TestEvents,
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {runInContext} from 'node:vm';
|
import {runInContext} from 'node:vm';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import sourcemapSupport = require('source-map-support');
|
import * as sourcemapSupport from 'source-map-support';
|
||||||
import {
|
import {
|
||||||
BufferedConsole,
|
BufferedConsole,
|
||||||
CustomConsole,
|
CustomConsole,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import exit = require('exit-x');
|
import exit from 'exit-x';
|
||||||
import type {
|
import type {
|
||||||
SerializableError,
|
SerializableError,
|
||||||
TestFileEvent,
|
TestFileEvent,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {glob} from 'glob';
|
import {glob} from 'glob';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
|
||||||
const OUTSIDE_JEST_VM_PROTOCOL = 'jest-main:';
|
const OUTSIDE_JEST_VM_PROTOCOL = 'jest-main:';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import nativeModule = require('module');
|
import nativeModule from 'module';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {URL, fileURLToPath, pathToFileURL} from 'url';
|
import {URL, fileURLToPath, pathToFileURL} from 'url';
|
||||||
import {
|
import {
|
||||||
|
@ -21,8 +21,8 @@ import {
|
||||||
import {parse as parseCjs} from 'cjs-module-lexer';
|
import {parse as parseCjs} from 'cjs-module-lexer';
|
||||||
import {CoverageInstrumenter, type V8Coverage} from 'collect-v8-coverage';
|
import {CoverageInstrumenter, type V8Coverage} from 'collect-v8-coverage';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import slash = require('slash');
|
import slash from 'slash';
|
||||||
import stripBOM = require('strip-bom');
|
import stripBOM from 'strip-bom';
|
||||||
import type {
|
import type {
|
||||||
Jest,
|
Jest,
|
||||||
JestEnvironment,
|
JestEnvironment,
|
||||||
|
|
|
@ -11,7 +11,7 @@ jest.mock('graceful-fs', () => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import {
|
import {
|
||||||
SNAPSHOT_GUIDE_LINK,
|
SNAPSHOT_GUIDE_LINK,
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import * as fs from 'graceful-fs';
|
import * as fs from 'graceful-fs';
|
||||||
import naturalCompare = require('natural-compare');
|
import naturalCompare from 'natural-compare';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import type {SnapshotData} from './types';
|
import type {SnapshotData} from './types';
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import type {
|
||||||
CustomParser as PrettierCustomParser,
|
CustomParser as PrettierCustomParser,
|
||||||
BuiltInParserName as PrettierParserName,
|
BuiltInParserName as PrettierParserName,
|
||||||
} from 'prettier-v2';
|
} from 'prettier-v2';
|
||||||
import semver = require('semver');
|
import * as semver from 'semver';
|
||||||
import {createSyncFn} from 'synckit';
|
import {createSyncFn} from 'synckit';
|
||||||
import type {InlineSnapshot} from './types';
|
import type {InlineSnapshot} from './types';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {createTranspilingRequire} from '@jest/transform';
|
import {createTranspilingRequire} from '@jest/transform';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {interopRequireDefault} from 'jest-util';
|
import {interopRequireDefault} from 'jest-util';
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import ansiRegex = require('ansi-regex');
|
import ansiRegex from 'ansi-regex';
|
||||||
import styles = require('ansi-styles');
|
import styles from 'ansi-styles';
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import type {SyncExpectationResult} from 'expect';
|
import type {SyncExpectationResult} from 'expect';
|
||||||
import format from 'pretty-format';
|
import format from 'pretty-format';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
import {getObjectSubset} from '@jest/expect-utils';
|
import {getObjectSubset} from '@jest/expect-utils';
|
||||||
import {getType, isPrimitive} from '@jest/get-type';
|
import {getType, isPrimitive} from '@jest/get-type';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {TraceMap, originalPositionFor} from '@jridgewell/trace-mapping';
|
import {TraceMap, originalPositionFor} from '@jridgewell/trace-mapping';
|
||||||
import callsites = require('callsites');
|
import callsites from 'callsites';
|
||||||
import {readFileSync} from 'graceful-fs';
|
import {readFileSync} from 'graceful-fs';
|
||||||
import type {SourceMapRegistry} from './types';
|
import type {SourceMapRegistry} from './types';
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue