Skip to content

Commit 18b645a

Browse files
committed
Use named import from pretty-format, not default
1 parent 4c3643c commit 18b645a

19 files changed

Lines changed: 26 additions & 20 deletions

File tree

packages/jest-circus/src/formatNodeAssertErrors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
printExpected,
1515
printReceived,
1616
} from 'jest-matcher-utils';
17-
import prettyFormat from 'pretty-format';
17+
import {format as prettyFormat} from 'pretty-format';
1818

1919
interface AssertionErrorWithStack extends AssertionError {
2020
stack: string;

packages/jest-circus/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import StackUtils = require('stack-utils');
1414
import type {AssertionResult, Status} from '@jest/test-result';
1515
import type {Circus, Global} from '@jest/types';
1616
import {ErrorWithStack, convertDescriptorToString, formatTime} from 'jest-util';
17-
import prettyFormat from 'pretty-format';
17+
import {format as prettyFormat} from 'pretty-format';
1818
import {ROOT_DESCRIBE_BLOCK_NAME, getState} from './state';
1919

2020
const stackUtils = new StackUtils({cwd: 'A path that does not exist'});

packages/jest-config/src/Deprecated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import chalk = require('chalk');
99
import type {DeprecatedOptions} from 'jest-validate';
10-
import prettyFormat from 'pretty-format';
10+
import {format as prettyFormat} from 'pretty-format';
1111

1212
const format = (value: unknown) => prettyFormat(value, {min: true});
1313

packages/jest-core/src/runGlobalHook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {createScriptTransformer} from '@jest/transform';
1212
import type {Config} from '@jest/types';
1313
import type {Test} from 'jest-runner';
1414
import {interopRequireDefault} from 'jest-util';
15-
import prettyFormat from 'pretty-format';
15+
import {format as prettyFormat} from 'pretty-format';
1616

1717
export default async ({
1818
allTests,

packages/jest-diff/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
*/
77

88
import chalk = require('chalk');
9-
import getType = require('jest-get-type');
10-
import prettyFormat, {plugins as prettyFormatPlugins} from 'pretty-format';
9+
import getType from 'jest-get-type';
10+
import {
11+
format as prettyFormat,
12+
plugins as prettyFormatPlugins,
13+
} from 'pretty-format';
1114
import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic';
1215
import {NO_DIFF_MESSAGE, SIMILAR_MESSAGE} from './constants';
1316
import {diffLinesRaw, diffLinesUnified, diffLinesUnified2} from './diffLines';

packages/jest-each/src/table/array.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import * as util from 'util';
1010
import type {Global} from '@jest/types';
11-
import pretty from 'pretty-format';
11+
import {format as pretty} from 'pretty-format';
1212
import type {EachTests} from '../bind';
1313

1414
const SUPPORTED_PLACEHOLDERS = /%[sdifjoOp%]/g;

packages/jest-each/src/table/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import type {Global} from '@jest/types';
1010
import {isPrimitive} from 'jest-get-type';
11-
import pretty from 'pretty-format';
11+
import {format as pretty} from 'pretty-format';
1212
import type {EachTests} from '../bind';
1313

1414
type Template = Record<string, unknown>;

packages/jest-each/src/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import chalk = require('chalk');
1010
import type {Global} from '@jest/types';
11-
import pretty from 'pretty-format';
11+
import {format as pretty} from 'pretty-format';
1212

1313
type TemplateData = Global.TemplateData;
1414

packages/jest-jasmine2/src/expectationResultFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import type {FailedAssertion} from '@jest/test-result';
9-
import prettyFormat from 'pretty-format';
9+
import {format as prettyFormat} from 'pretty-format';
1010

1111
function messageFormatter({error, message, passed}: Options) {
1212
if (passed) {

packages/jest-jasmine2/src/isError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import prettyFormat from 'pretty-format';
8+
import {format as prettyFormat} from 'pretty-format';
99

1010
export default function isError(
1111
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types

0 commit comments

Comments
 (0)