From de0fc738c23bc31940b9a2b71caa78986bc94072 Mon Sep 17 00:00:00 2001 From: Yadd Date: Sat, 16 Jul 2022 13:03:04 +0800 Subject: [PATCH] various workaround for typescript definitions Forwarded: not-needed Last-Update: 2022-02-10 Gbp-Pq: Name fix-typescript.patch --- packages/babel-jest/src/loadBabelConfig.ts | 1 + packages/expect/src/jestMatchersObject.ts | 2 ++ packages/jest-circus/src/formatNodeAssertErrors.ts | 1 + packages/jest-circus/src/types.ts | 1 + packages/jest-circus/src/utils.ts | 1 + packages/jest-cli/src/cli/index.ts | 1 + packages/jest-config/src/Deprecated.ts | 1 + packages/jest-config/src/ValidConfig.ts | 1 + packages/jest-config/src/readConfigFileAndSetRootDir.ts | 1 + packages/jest-core/src/TestScheduler.ts | 2 ++ packages/jest-core/src/TestWatcher.ts | 4 +++- packages/jest-core/src/collectHandles.ts | 6 +++--- packages/jest-core/src/runGlobalHook.ts | 1 + packages/jest-diff/src/index.ts | 2 ++ packages/jest-diff/src/normalizeDiffOptions.ts | 1 + packages/jest-diff/src/types.ts | 1 + packages/jest-each/src/table/array.ts | 1 + packages/jest-each/src/table/interpolation.ts | 1 + packages/jest-each/src/validation.ts | 1 + packages/jest-globals/src/index.ts | 1 + packages/jest-haste-map/src/HasteFS.ts | 3 +++ packages/jest-haste-map/src/ModuleMap.ts | 1 + packages/jest-haste-map/src/crawlers/watchman.ts | 1 + packages/jest-haste-map/src/index.ts | 2 ++ packages/jest-jasmine2/src/expectationResultFactory.ts | 1 + packages/jest-jasmine2/src/isError.ts | 1 + packages/jest-jasmine2/src/types.ts | 1 + packages/jest-leak-detector/src/index.ts | 1 + packages/jest-matcher-utils/src/index.ts | 2 ++ packages/jest-message-util/src/index.ts | 1 + packages/jest-mock/src/index.ts | 3 +++ packages/jest-reporters/src/CoverageReporter.ts | 1 + packages/jest-resolve/src/defaultResolver.ts | 1 + packages/jest-runner/src/index.ts | 4 ++++ packages/jest-runner/src/types.ts | 3 ++- packages/jest-runtime/src/index.ts | 1 + packages/jest-snapshot/src/printSnapshot.ts | 1 + packages/jest-snapshot/src/utils.ts | 1 + packages/jest-test-result/src/types.ts | 1 + packages/jest-validate/src/utils.ts | 1 + packages/jest-worker/src/workers/NodeThreadsWorker.ts | 2 +- 41 files changed, 58 insertions(+), 6 deletions(-) diff --git a/packages/babel-jest/src/loadBabelConfig.ts b/packages/babel-jest/src/loadBabelConfig.ts index a9aae6c..7bece5b 100644 --- a/packages/babel-jest/src/loadBabelConfig.ts +++ b/packages/babel-jest/src/loadBabelConfig.ts @@ -6,4 +6,5 @@ */ // this is a separate file so it can be mocked in tests +// @ts-ignore export {loadPartialConfig, loadPartialConfigAsync} from '@babel/core'; diff --git a/packages/expect/src/jestMatchersObject.ts b/packages/expect/src/jestMatchersObject.ts index 544530b..394620d 100644 --- a/packages/expect/src/jestMatchersObject.ts +++ b/packages/expect/src/jestMatchersObject.ts @@ -99,6 +99,7 @@ export const setMatchers = ( configurable: true, enumerable: true, value: (...sample: [unknown, ...Array]) => +// @ts-ignore new CustomMatcher(false, ...sample), writable: true, }); @@ -106,6 +107,7 @@ export const setMatchers = ( configurable: true, enumerable: true, value: (...sample: [unknown, ...Array]) => +// @ts-ignore new CustomMatcher(true, ...sample), writable: true, }); diff --git a/packages/jest-circus/src/formatNodeAssertErrors.ts b/packages/jest-circus/src/formatNodeAssertErrors.ts index 2f7d56d..99ff1b7 100644 --- a/packages/jest-circus/src/formatNodeAssertErrors.ts +++ b/packages/jest-circus/src/formatNodeAssertErrors.ts @@ -14,6 +14,7 @@ import { printExpected, printReceived, } from 'jest-matcher-utils'; +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; interface AssertionErrorWithStack extends AssertionError { diff --git a/packages/jest-circus/src/types.ts b/packages/jest-circus/src/types.ts index 98f36bf..2e8e87a 100644 --- a/packages/jest-circus/src/types.ts +++ b/packages/jest-circus/src/types.ts @@ -7,6 +7,7 @@ // Used as type import type {Circus} from '@jest/types'; +// @ts-ignore import expect = require('expect'); export const STATE_SYM = Symbol( diff --git a/packages/jest-circus/src/utils.ts b/packages/jest-circus/src/utils.ts index ff0eb05..29540e0 100644 --- a/packages/jest-circus/src/utils.ts +++ b/packages/jest-circus/src/utils.ts @@ -14,6 +14,7 @@ import StackUtils = require('stack-utils'); import type {AssertionResult, Status} from '@jest/test-result'; import type {Circus, Global} from '@jest/types'; import {ErrorWithStack, convertDescriptorToString, formatTime} from 'jest-util'; +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; import {ROOT_DESCRIBE_BLOCK_NAME, getState} from './state'; diff --git a/packages/jest-cli/src/cli/index.ts b/packages/jest-cli/src/cli/index.ts index 4269f5d..8d4f6ca 100644 --- a/packages/jest-cli/src/cli/index.ts +++ b/packages/jest-cli/src/cli/index.ts @@ -55,6 +55,7 @@ export const buildArgv = (maybeArgv?: Array): Config.Argv => { const rawArgv: Config.Argv | Array = maybeArgv || process.argv.slice(2); +// @ts-ignore const argv: Config.Argv = yargs(rawArgv) .usage(args.usage) .version(version) diff --git a/packages/jest-config/src/Deprecated.ts b/packages/jest-config/src/Deprecated.ts index 86aa222..78d3d29 100644 --- a/packages/jest-config/src/Deprecated.ts +++ b/packages/jest-config/src/Deprecated.ts @@ -7,6 +7,7 @@ import chalk = require('chalk'); import type {DeprecatedOptions} from 'jest-validate'; +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; const format = (value: unknown) => prettyFormat(value, {min: true}); diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index 75f475c..87e2b56 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -8,6 +8,7 @@ import type {Config} from '@jest/types'; import {replacePathSepForRegex} from 'jest-regex-util'; import {multipleValidOptions} from 'jest-validate'; +// @ts-ignore import {DEFAULT_OPTIONS as PRETTY_FORMAT_DEFAULTS} from 'pretty-format'; import {NODE_MODULES} from './constants'; diff --git a/packages/jest-config/src/readConfigFileAndSetRootDir.ts b/packages/jest-config/src/readConfigFileAndSetRootDir.ts index 68155ff..701810f 100644 --- a/packages/jest-config/src/readConfigFileAndSetRootDir.ts +++ b/packages/jest-config/src/readConfigFileAndSetRootDir.ts @@ -35,6 +35,7 @@ export default async function readConfigFileAndSetRootDir( configObject = await loadTSConfigFile(configPath); } else if (isJSON) { const fileContent = fs.readFileSync(configPath, 'utf8'); +// @ts-ignore configObject = parseJson(stripJsonComments(fileContent), configPath); } else { configObject = await requireOrImportModule(configPath); diff --git a/packages/jest-core/src/TestScheduler.ts b/packages/jest-core/src/TestScheduler.ts index 708e1a7..d1cc304 100644 --- a/packages/jest-core/src/TestScheduler.ts +++ b/packages/jest-core/src/TestScheduler.ts @@ -267,6 +267,7 @@ class TestScheduler { await testRunner.runTests( tests, +// @ts-ignore watcher, undefined, undefined, @@ -278,6 +279,7 @@ class TestScheduler { } else { await testRunner.runTests( tests, +// @ts-ignore watcher, onTestFileStart, onResult, diff --git a/packages/jest-core/src/TestWatcher.ts b/packages/jest-core/src/TestWatcher.ts index 03f19b1..eb602e2 100644 --- a/packages/jest-core/src/TestWatcher.ts +++ b/packages/jest-core/src/TestWatcher.ts @@ -11,7 +11,8 @@ type State = { interrupted: boolean; }; -export default class TestWatcher extends emittery<{change: State}> { +// @ts-ignore +export default class TestWatcher extends emittery { state: State; private _isWatchMode: boolean; @@ -23,6 +24,7 @@ export default class TestWatcher extends emittery<{change: State}> { async setState(state: State): Promise { Object.assign(this.state, state); +// @ts-ignore await this.emit('change', this.state); } diff --git a/packages/jest-core/src/collectHandles.ts b/packages/jest-core/src/collectHandles.ts index 72fea6e..b539461 100644 --- a/packages/jest-core/src/collectHandles.ts +++ b/packages/jest-core/src/collectHandles.ts @@ -40,7 +40,7 @@ function stackIsFromUser(stack: string) { const alwaysActive = () => true; -// @ts-expect-error: doesn't exist in v10 typings +// @ts-ignore const hasWeakRef = typeof WeakRef === 'function'; const asyncSleep = promisify(setTimeout); @@ -97,13 +97,13 @@ export default function collectHandles(): HandleCollectionResult { // Timer that supports hasRef (Node v11+) if ('hasRef' in resource) { if (hasWeakRef) { - // @ts-expect-error: doesn't exist in v10 typings + // @ts-ignore const ref = new WeakRef(resource); isActive = () => { return ref.deref()?.hasRef() ?? false; }; } else { - // @ts-expect-error: doesn't exist in v10 typings + // @ts-ignore isActive = resource.hasRef.bind(resource); } } else { diff --git a/packages/jest-core/src/runGlobalHook.ts b/packages/jest-core/src/runGlobalHook.ts index 60de308..9fd4653 100644 --- a/packages/jest-core/src/runGlobalHook.ts +++ b/packages/jest-core/src/runGlobalHook.ts @@ -9,6 +9,7 @@ import * as util from 'util'; import type {Test} from '@jest/test-result'; import {createScriptTransformer} from '@jest/transform'; import type {Config} from '@jest/types'; +// @ts-ignore import prettyFormat from 'pretty-format'; export default async function runGlobalHook({ diff --git a/packages/jest-diff/src/index.ts b/packages/jest-diff/src/index.ts index 399b5cc..78fdcf1 100644 --- a/packages/jest-diff/src/index.ts +++ b/packages/jest-diff/src/index.ts @@ -8,9 +8,11 @@ import chalk = require('chalk'); import {getType} from 'jest-get-type'; import { +// @ts-ignore format as prettyFormat, plugins as prettyFormatPlugins, } from 'pretty-format'; +// @ts-ignore import type {PrettyFormatOptions} from 'pretty-format'; import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic'; import {NO_DIFF_MESSAGE, SIMILAR_MESSAGE} from './constants'; diff --git a/packages/jest-diff/src/normalizeDiffOptions.ts b/packages/jest-diff/src/normalizeDiffOptions.ts index 5e7cb93..1f97cd4 100644 --- a/packages/jest-diff/src/normalizeDiffOptions.ts +++ b/packages/jest-diff/src/normalizeDiffOptions.ts @@ -6,6 +6,7 @@ */ import chalk = require('chalk'); +// @ts-ignore import type {CompareKeys} from 'pretty-format'; import type {DiffOptions, DiffOptionsNormalized} from './types'; diff --git a/packages/jest-diff/src/types.ts b/packages/jest-diff/src/types.ts index da33eb3..147aadf 100644 --- a/packages/jest-diff/src/types.ts +++ b/packages/jest-diff/src/types.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ +// @ts-ignore import type {CompareKeys} from 'pretty-format'; export type DiffOptionsColor = (arg: string) => string; // subset of Chalk type diff --git a/packages/jest-each/src/table/array.ts b/packages/jest-each/src/table/array.ts index a4fb9d5..670737d 100644 --- a/packages/jest-each/src/table/array.ts +++ b/packages/jest-each/src/table/array.ts @@ -8,6 +8,7 @@ import * as util from 'util'; import type {Global} from '@jest/types'; +// @ts-ignore import {format as pretty} from 'pretty-format'; import type {EachTests} from '../bind'; import type {Templates} from './interpolation'; diff --git a/packages/jest-each/src/table/interpolation.ts b/packages/jest-each/src/table/interpolation.ts index b2b5160..26ebf35 100644 --- a/packages/jest-each/src/table/interpolation.ts +++ b/packages/jest-each/src/table/interpolation.ts @@ -7,6 +7,7 @@ */ import {isPrimitive} from 'jest-get-type'; +// @ts-ignore import {format as pretty} from 'pretty-format'; export type Template = Record; diff --git a/packages/jest-each/src/validation.ts b/packages/jest-each/src/validation.ts index 52238ed..23aadb1 100644 --- a/packages/jest-each/src/validation.ts +++ b/packages/jest-each/src/validation.ts @@ -8,6 +8,7 @@ import chalk = require('chalk'); import type {Global} from '@jest/types'; +// @ts-ignore import {format as pretty} from 'pretty-format'; type TemplateData = Global.TemplateData; diff --git a/packages/jest-globals/src/index.ts b/packages/jest-globals/src/index.ts index 772ee1a..ea60946 100644 --- a/packages/jest-globals/src/index.ts +++ b/packages/jest-globals/src/index.ts @@ -7,6 +7,7 @@ import type {Jest} from '@jest/environment'; import type {Global} from '@jest/types'; +// @ts-ignore import importedExpect = require('expect'); export declare const jest: Jest; diff --git a/packages/jest-haste-map/src/HasteFS.ts b/packages/jest-haste-map/src/HasteFS.ts index 64478ee..d99c955 100644 --- a/packages/jest-haste-map/src/HasteFS.ts +++ b/packages/jest-haste-map/src/HasteFS.ts @@ -60,6 +60,7 @@ export default class HasteFS { } *getAbsoluteFileIterator(): Iterable { +// @ts-ignore for (const file of this.getFileIterator()) { yield fastPath.resolve(this._rootDir, file); } @@ -70,6 +71,7 @@ export default class HasteFS { pattern = new RegExp(pattern); } const files = []; +// @ts-ignore for (const file of this.getAbsoluteFileIterator()) { if (pattern.test(file)) { files.push(file); @@ -85,6 +87,7 @@ export default class HasteFS { const files = new Set(); const matcher = globsToMatcher(globs); +// @ts-ignore for (const file of this.getAbsoluteFileIterator()) { const filePath = root ? fastPath.relative(root, file) : file; if (matcher(replacePathSepForGlob(filePath))) { diff --git a/packages/jest-haste-map/src/ModuleMap.ts b/packages/jest-haste-map/src/ModuleMap.ts index 960af85..1e1001d 100644 --- a/packages/jest-haste-map/src/ModuleMap.ts +++ b/packages/jest-haste-map/src/ModuleMap.ts @@ -184,6 +184,7 @@ export default class ModuleMap implements IModuleMap { const previousSet = relativePathSet; const duplicates = new Map(); +// @ts-ignore for (const [relativePath, type] of previousSet) { const duplicatePath = fastPath.resolve(this._raw.rootDir, relativePath); duplicates.set(duplicatePath, type); diff --git a/packages/jest-haste-map/src/crawlers/watchman.ts b/packages/jest-haste-map/src/crawlers/watchman.ts index b7e63ab..69ab2f7 100644 --- a/packages/jest-haste-map/src/crawlers/watchman.ts +++ b/packages/jest-haste-map/src/crawlers/watchman.ts @@ -274,6 +274,7 @@ export = async function watchmanCrawl(options: CrawlerOptions): Promise<{ throw clientError; } +// @ts-ignore for (const [watchRoot, response] of results) { const fsRoot = normalizePathSep(watchRoot); const relativeFsRoot = fastPath.relative(rootDir, fsRoot); diff --git a/packages/jest-haste-map/src/index.ts b/packages/jest-haste-map/src/index.ts index 77669a2..1a669bb 100644 --- a/packages/jest-haste-map/src/index.ts +++ b/packages/jest-haste-map/src/index.ts @@ -676,11 +676,13 @@ export default class HasteMap extends EventEmitter { filesToProcess = changedFiles; } +// @ts-ignore for (const [relativeFilePath, fileMetadata] of removedFiles) { this._recoverDuplicates(hasteMap, relativeFilePath, fileMetadata[H.ID]); } const promises = []; +// @ts-ignore for (const relativeFilePath of filesToProcess.keys()) { if ( this._options.skipPackageJson && diff --git a/packages/jest-jasmine2/src/expectationResultFactory.ts b/packages/jest-jasmine2/src/expectationResultFactory.ts index fec55f2..1fd0e45 100644 --- a/packages/jest-jasmine2/src/expectationResultFactory.ts +++ b/packages/jest-jasmine2/src/expectationResultFactory.ts @@ -6,6 +6,7 @@ */ import type {FailedAssertion} from '@jest/test-result'; +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; function messageFormatter({error, message, passed}: Options) { diff --git a/packages/jest-jasmine2/src/isError.ts b/packages/jest-jasmine2/src/isError.ts index 05f6872..23026d8 100644 --- a/packages/jest-jasmine2/src/isError.ts +++ b/packages/jest-jasmine2/src/isError.ts @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; export default function isError( diff --git a/packages/jest-jasmine2/src/types.ts b/packages/jest-jasmine2/src/types.ts index 4d0ff24..4392b3a 100644 --- a/packages/jest-jasmine2/src/types.ts +++ b/packages/jest-jasmine2/src/types.ts @@ -7,6 +7,7 @@ import type {AssertionError} from 'assert'; import type {Config} from '@jest/types'; +// @ts-ignore import expect = require('expect'); import type CallTracker from './jasmine/CallTracker'; import type Env from './jasmine/Env'; diff --git a/packages/jest-leak-detector/src/index.ts b/packages/jest-leak-detector/src/index.ts index 2f7bb31..f409a45 100644 --- a/packages/jest-leak-detector/src/index.ts +++ b/packages/jest-leak-detector/src/index.ts @@ -11,6 +11,7 @@ import {promisify} from 'util'; import {setFlagsFromString} from 'v8'; import {runInNewContext} from 'vm'; import {isPrimitive} from 'jest-get-type'; +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; const tick = promisify(setImmediate); diff --git a/packages/jest-matcher-utils/src/index.ts b/packages/jest-matcher-utils/src/index.ts index 7210d37..786eb45 100644 --- a/packages/jest-matcher-utils/src/index.ts +++ b/packages/jest-matcher-utils/src/index.ts @@ -14,12 +14,14 @@ import { DIFF_INSERT, Diff, DiffOptions as ImportDiffOptions, +// @ts-ignore diff as diffDefault, diffStringsRaw, diffStringsUnified, } from 'jest-diff'; import {getType, isPrimitive} from 'jest-get-type'; import { +// @ts-ignore format as prettyFormat, plugins as prettyFormatPlugins, } from 'pretty-format'; diff --git a/packages/jest-message-util/src/index.ts b/packages/jest-message-util/src/index.ts index 1aa0899..80f9011 100644 --- a/packages/jest-message-util/src/index.ts +++ b/packages/jest-message-util/src/index.ts @@ -14,6 +14,7 @@ import micromatch = require('micromatch'); import slash = require('slash'); import StackUtils = require('stack-utils'); import type {Config, TestResult} from '@jest/types'; +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; import type {Frame} from './types'; diff --git a/packages/jest-mock/src/index.ts b/packages/jest-mock/src/index.ts index fb0e99f..1c47ab2 100644 --- a/packages/jest-mock/src/index.ts +++ b/packages/jest-mock/src/index.ts @@ -653,6 +653,7 @@ export class ModuleMocker { const mockImpl = mockConfig.specificMockImpls.length ? mockConfig.specificMockImpls.shift() : mockConfig.mockImpl; +// @ts-ignore return mockImpl && mockImpl.apply(this, arguments); } @@ -663,10 +664,12 @@ export class ModuleMocker { specificMockImpl = mockConfig.mockImpl; } if (specificMockImpl) { +// @ts-ignore return specificMockImpl.apply(this, arguments); } // Otherwise use prototype implementation if (f._protoImpl) { +// @ts-ignore return f._protoImpl.apply(this, arguments); } diff --git a/packages/jest-reporters/src/CoverageReporter.ts b/packages/jest-reporters/src/CoverageReporter.ts index 63da913..62fe6e1 100644 --- a/packages/jest-reporters/src/CoverageReporter.ts +++ b/packages/jest-reporters/src/CoverageReporter.ts @@ -456,6 +456,7 @@ export default class CoverageReporter extends BaseReporter { const converter = v8toIstanbul( res.url, fileTransform?.wrapperLength ?? 0, +// @ts-ignore fileTransform && sourcemapContent ? { originalSource: fileTransform.originalCode, diff --git a/packages/jest-resolve/src/defaultResolver.ts b/packages/jest-resolve/src/defaultResolver.ts index 1c461fe..be0d7e9 100644 --- a/packages/jest-resolve/src/defaultResolver.ts +++ b/packages/jest-resolve/src/defaultResolver.ts @@ -11,6 +11,7 @@ import {sync as resolveSync} from 'resolve'; import { Options as ResolveExportsOptions, resolve as resolveExports, +// @ts-ignore } from 'resolve.exports'; import type {Config} from '@jest/types'; import { diff --git a/packages/jest-runner/src/index.ts b/packages/jest-runner/src/index.ts index 2a471a3..7ff8d97 100644 --- a/packages/jest-runner/src/index.ts +++ b/packages/jest-runner/src/index.ts @@ -49,6 +49,7 @@ export type { export default class TestRunner { private readonly _globalConfig: Config.GlobalConfig; private readonly _context: TestRunnerContext; +// @ts-ignore private readonly eventEmitter = new Emittery(); readonly __PRIVATE_UNSTABLE_API_supportsEventEmitters__: boolean = true; @@ -224,7 +225,9 @@ export default class TestRunner { }); const onInterrupt = new Promise((_, reject) => { +// @ts-ignore watcher.on('change', state => { +// @ts-ignore if (state.interrupted) { reject(new CancelRun()); } @@ -272,6 +275,7 @@ export default class TestRunner { eventName: Name, listener: (eventData: TestEvents[Name]) => void | Promise, ): Emittery.UnsubscribeFn { +// @ts-ignore return this.eventEmitter.on(eventName, listener); } } diff --git a/packages/jest-runner/src/types.ts b/packages/jest-runner/src/types.ts index 65d0f7f..d99c7d5 100644 --- a/packages/jest-runner/src/types.ts +++ b/packages/jest-runner/src/types.ts @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ +// @ts-ignore import Emittery = require('emittery'); import type {JestEnvironment} from '@jest/environment'; import type { @@ -54,7 +55,7 @@ export type TestRunnerSerializedContext = { // TODO: Should live in `@jest/core` or `jest-watcher` type WatcherState = {interrupted: boolean}; -export interface TestWatcher extends Emittery<{change: WatcherState}> { +export interface TestWatcher extends Emittery { state: WatcherState; setState(state: WatcherState): void; isInterrupted(): boolean; diff --git a/packages/jest-runtime/src/index.ts b/packages/jest-runtime/src/index.ts index 410dd84..beae8cd 100644 --- a/packages/jest-runtime/src/index.ts +++ b/packages/jest-runtime/src/index.ts @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ +// @ts-ignore import * as nativeModule from 'module'; import * as path from 'path'; import {URL, fileURLToPath, pathToFileURL} from 'url'; diff --git a/packages/jest-snapshot/src/printSnapshot.ts b/packages/jest-snapshot/src/printSnapshot.ts index 1d3af52..a9aff4b 100644 --- a/packages/jest-snapshot/src/printSnapshot.ts +++ b/packages/jest-snapshot/src/printSnapshot.ts @@ -34,6 +34,7 @@ import { getLabelPrinter, matcherHint, } from 'jest-matcher-utils'; +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; import { aBackground2, diff --git a/packages/jest-snapshot/src/utils.ts b/packages/jest-snapshot/src/utils.ts index 1f11758..951dba4 100644 --- a/packages/jest-snapshot/src/utils.ts +++ b/packages/jest-snapshot/src/utils.ts @@ -12,6 +12,7 @@ import naturalCompare = require('natural-compare'); import type {Config} from '@jest/types'; import { OptionsReceived as PrettyFormatOptions, +// @ts-ignore format as prettyFormat, } from 'pretty-format'; import {getSerializers} from './plugins'; diff --git a/packages/jest-test-result/src/types.ts b/packages/jest-test-result/src/types.ts index d911ac8..b47bd09 100644 --- a/packages/jest-test-result/src/types.ts +++ b/packages/jest-test-result/src/types.ts @@ -10,6 +10,7 @@ import type {CoverageMap, CoverageMapData} from 'istanbul-lib-coverage'; import type {ConsoleBuffer} from '@jest/console'; import type {Config, TestResult, TransformTypes} from '@jest/types'; import type {FS as HasteFS, ModuleMap} from 'jest-haste-map'; +// @ts-ignore import type Resolver from 'jest-resolve'; export interface RuntimeTransformResult extends TransformTypes.TransformResult { diff --git a/packages/jest-validate/src/utils.ts b/packages/jest-validate/src/utils.ts index 569861a..1b0a877 100644 --- a/packages/jest-validate/src/utils.ts +++ b/packages/jest-validate/src/utils.ts @@ -7,6 +7,7 @@ import chalk = require('chalk'); import leven from 'leven'; +// @ts-ignore import {format as prettyFormat} from 'pretty-format'; const BULLET: string = chalk.bold('\u25cf'); diff --git a/packages/jest-worker/src/workers/NodeThreadsWorker.ts b/packages/jest-worker/src/workers/NodeThreadsWorker.ts index 136b648..3a99f2d 100644 --- a/packages/jest-worker/src/workers/NodeThreadsWorker.ts +++ b/packages/jest-worker/src/workers/NodeThreadsWorker.ts @@ -61,7 +61,7 @@ export default class ExperimentalWorker implements WorkerInterface { initialize(): void { this._worker = new Worker(path.resolve(__dirname, './threadChild.js'), { eval: false, - // @ts-expect-error: added in newer versions + // @ts-ignore resourceLimits: this._options.resourceLimits, stderr: true, stdout: true,