various workaround for typescript definitions
Forwarded: not-needed Last-Update: 2022-02-10 Gbp-Pq: Name fix-typescript.patch
This commit is contained in:
parent
5682c77255
commit
de0fc738c2
|
@ -6,4 +6,5 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// this is a separate file so it can be mocked in tests
|
// this is a separate file so it can be mocked in tests
|
||||||
|
// @ts-ignore
|
||||||
export {loadPartialConfig, loadPartialConfigAsync} from '@babel/core';
|
export {loadPartialConfig, loadPartialConfigAsync} from '@babel/core';
|
||||||
|
|
|
@ -99,6 +99,7 @@ export const setMatchers = <State extends MatcherState = MatcherState>(
|
||||||
configurable: true,
|
configurable: true,
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
value: (...sample: [unknown, ...Array<unknown>]) =>
|
value: (...sample: [unknown, ...Array<unknown>]) =>
|
||||||
|
// @ts-ignore
|
||||||
new CustomMatcher(false, ...sample),
|
new CustomMatcher(false, ...sample),
|
||||||
writable: true,
|
writable: true,
|
||||||
});
|
});
|
||||||
|
@ -106,6 +107,7 @@ export const setMatchers = <State extends MatcherState = MatcherState>(
|
||||||
configurable: true,
|
configurable: true,
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
value: (...sample: [unknown, ...Array<unknown>]) =>
|
value: (...sample: [unknown, ...Array<unknown>]) =>
|
||||||
|
// @ts-ignore
|
||||||
new CustomMatcher(true, ...sample),
|
new CustomMatcher(true, ...sample),
|
||||||
writable: true,
|
writable: true,
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {
|
||||||
printExpected,
|
printExpected,
|
||||||
printReceived,
|
printReceived,
|
||||||
} from 'jest-matcher-utils';
|
} from 'jest-matcher-utils';
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
|
|
||||||
interface AssertionErrorWithStack extends AssertionError {
|
interface AssertionErrorWithStack extends AssertionError {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
// Used as type
|
// Used as type
|
||||||
import type {Circus} from '@jest/types';
|
import type {Circus} from '@jest/types';
|
||||||
|
// @ts-ignore
|
||||||
import expect = require('expect');
|
import expect = require('expect');
|
||||||
|
|
||||||
export const STATE_SYM = Symbol(
|
export const STATE_SYM = Symbol(
|
||||||
|
|
|
@ -14,6 +14,7 @@ import StackUtils = require('stack-utils');
|
||||||
import type {AssertionResult, Status} from '@jest/test-result';
|
import type {AssertionResult, Status} from '@jest/test-result';
|
||||||
import type {Circus, Global} from '@jest/types';
|
import type {Circus, Global} from '@jest/types';
|
||||||
import {ErrorWithStack, convertDescriptorToString, formatTime} from 'jest-util';
|
import {ErrorWithStack, convertDescriptorToString, formatTime} from 'jest-util';
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
import {ROOT_DESCRIBE_BLOCK_NAME, getState} from './state';
|
import {ROOT_DESCRIBE_BLOCK_NAME, getState} from './state';
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ export const buildArgv = (maybeArgv?: Array<string>): Config.Argv => {
|
||||||
|
|
||||||
const rawArgv: Config.Argv | Array<string> =
|
const rawArgv: Config.Argv | Array<string> =
|
||||||
maybeArgv || process.argv.slice(2);
|
maybeArgv || process.argv.slice(2);
|
||||||
|
// @ts-ignore
|
||||||
const argv: Config.Argv = yargs(rawArgv)
|
const argv: Config.Argv = yargs(rawArgv)
|
||||||
.usage(args.usage)
|
.usage(args.usage)
|
||||||
.version(version)
|
.version(version)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk = require('chalk');
|
||||||
import type {DeprecatedOptions} from 'jest-validate';
|
import type {DeprecatedOptions} from 'jest-validate';
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
|
|
||||||
const format = (value: unknown) => prettyFormat(value, {min: true});
|
const format = (value: unknown) => prettyFormat(value, {min: true});
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {replacePathSepForRegex} from 'jest-regex-util';
|
import {replacePathSepForRegex} from 'jest-regex-util';
|
||||||
import {multipleValidOptions} from 'jest-validate';
|
import {multipleValidOptions} from 'jest-validate';
|
||||||
|
// @ts-ignore
|
||||||
import {DEFAULT_OPTIONS as PRETTY_FORMAT_DEFAULTS} from 'pretty-format';
|
import {DEFAULT_OPTIONS as PRETTY_FORMAT_DEFAULTS} from 'pretty-format';
|
||||||
import {NODE_MODULES} from './constants';
|
import {NODE_MODULES} from './constants';
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ export default async function readConfigFileAndSetRootDir(
|
||||||
configObject = await loadTSConfigFile(configPath);
|
configObject = await loadTSConfigFile(configPath);
|
||||||
} else if (isJSON) {
|
} else if (isJSON) {
|
||||||
const fileContent = fs.readFileSync(configPath, 'utf8');
|
const fileContent = fs.readFileSync(configPath, 'utf8');
|
||||||
|
// @ts-ignore
|
||||||
configObject = parseJson(stripJsonComments(fileContent), configPath);
|
configObject = parseJson(stripJsonComments(fileContent), configPath);
|
||||||
} else {
|
} else {
|
||||||
configObject = await requireOrImportModule<any>(configPath);
|
configObject = await requireOrImportModule<any>(configPath);
|
||||||
|
|
|
@ -267,6 +267,7 @@ class TestScheduler {
|
||||||
|
|
||||||
await testRunner.runTests(
|
await testRunner.runTests(
|
||||||
tests,
|
tests,
|
||||||
|
// @ts-ignore
|
||||||
watcher,
|
watcher,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
|
@ -278,6 +279,7 @@ class TestScheduler {
|
||||||
} else {
|
} else {
|
||||||
await testRunner.runTests(
|
await testRunner.runTests(
|
||||||
tests,
|
tests,
|
||||||
|
// @ts-ignore
|
||||||
watcher,
|
watcher,
|
||||||
onTestFileStart,
|
onTestFileStart,
|
||||||
onResult,
|
onResult,
|
||||||
|
|
|
@ -11,7 +11,8 @@ type State = {
|
||||||
interrupted: boolean;
|
interrupted: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class TestWatcher extends emittery<{change: State}> {
|
// @ts-ignore
|
||||||
|
export default class TestWatcher extends emittery {
|
||||||
state: State;
|
state: State;
|
||||||
private _isWatchMode: boolean;
|
private _isWatchMode: boolean;
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ export default class TestWatcher extends emittery<{change: State}> {
|
||||||
|
|
||||||
async setState(state: State): Promise<void> {
|
async setState(state: State): Promise<void> {
|
||||||
Object.assign(this.state, state);
|
Object.assign(this.state, state);
|
||||||
|
// @ts-ignore
|
||||||
await this.emit('change', this.state);
|
await this.emit('change', this.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ function stackIsFromUser(stack: string) {
|
||||||
|
|
||||||
const alwaysActive = () => true;
|
const alwaysActive = () => true;
|
||||||
|
|
||||||
// @ts-expect-error: doesn't exist in v10 typings
|
// @ts-ignore
|
||||||
const hasWeakRef = typeof WeakRef === 'function';
|
const hasWeakRef = typeof WeakRef === 'function';
|
||||||
|
|
||||||
const asyncSleep = promisify(setTimeout);
|
const asyncSleep = promisify(setTimeout);
|
||||||
|
@ -97,13 +97,13 @@ export default function collectHandles(): HandleCollectionResult {
|
||||||
// Timer that supports hasRef (Node v11+)
|
// Timer that supports hasRef (Node v11+)
|
||||||
if ('hasRef' in resource) {
|
if ('hasRef' in resource) {
|
||||||
if (hasWeakRef) {
|
if (hasWeakRef) {
|
||||||
// @ts-expect-error: doesn't exist in v10 typings
|
// @ts-ignore
|
||||||
const ref = new WeakRef(resource);
|
const ref = new WeakRef(resource);
|
||||||
isActive = () => {
|
isActive = () => {
|
||||||
return ref.deref()?.hasRef() ?? false;
|
return ref.deref()?.hasRef() ?? false;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// @ts-expect-error: doesn't exist in v10 typings
|
// @ts-ignore
|
||||||
isActive = resource.hasRef.bind(resource);
|
isActive = resource.hasRef.bind(resource);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -9,6 +9,7 @@ import * as util from 'util';
|
||||||
import type {Test} from '@jest/test-result';
|
import type {Test} from '@jest/test-result';
|
||||||
import {createScriptTransformer} from '@jest/transform';
|
import {createScriptTransformer} from '@jest/transform';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
// @ts-ignore
|
||||||
import prettyFormat from 'pretty-format';
|
import prettyFormat from 'pretty-format';
|
||||||
|
|
||||||
export default async function runGlobalHook({
|
export default async function runGlobalHook({
|
||||||
|
|
|
@ -8,9 +8,11 @@
|
||||||
import chalk = require('chalk');
|
import chalk = require('chalk');
|
||||||
import {getType} from 'jest-get-type';
|
import {getType} from 'jest-get-type';
|
||||||
import {
|
import {
|
||||||
|
// @ts-ignore
|
||||||
format as prettyFormat,
|
format as prettyFormat,
|
||||||
plugins as prettyFormatPlugins,
|
plugins as prettyFormatPlugins,
|
||||||
} from 'pretty-format';
|
} from 'pretty-format';
|
||||||
|
// @ts-ignore
|
||||||
import type {PrettyFormatOptions} from 'pretty-format';
|
import type {PrettyFormatOptions} from 'pretty-format';
|
||||||
import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic';
|
import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic';
|
||||||
import {NO_DIFF_MESSAGE, SIMILAR_MESSAGE} from './constants';
|
import {NO_DIFF_MESSAGE, SIMILAR_MESSAGE} from './constants';
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk = require('chalk');
|
||||||
|
// @ts-ignore
|
||||||
import type {CompareKeys} from 'pretty-format';
|
import type {CompareKeys} from 'pretty-format';
|
||||||
import type {DiffOptions, DiffOptionsNormalized} from './types';
|
import type {DiffOptions, DiffOptionsNormalized} from './types';
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* 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.
|
||||||
*/
|
*/
|
||||||
|
// @ts-ignore
|
||||||
import type {CompareKeys} from 'pretty-format';
|
import type {CompareKeys} from 'pretty-format';
|
||||||
|
|
||||||
export type DiffOptionsColor = (arg: string) => string; // subset of Chalk type
|
export type DiffOptionsColor = (arg: string) => string; // subset of Chalk type
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
import * as util from 'util';
|
import * as util from 'util';
|
||||||
import type {Global} from '@jest/types';
|
import type {Global} from '@jest/types';
|
||||||
|
// @ts-ignore
|
||||||
import {format as pretty} from 'pretty-format';
|
import {format as pretty} from 'pretty-format';
|
||||||
import type {EachTests} from '../bind';
|
import type {EachTests} from '../bind';
|
||||||
import type {Templates} from './interpolation';
|
import type {Templates} from './interpolation';
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {isPrimitive} from 'jest-get-type';
|
import {isPrimitive} from 'jest-get-type';
|
||||||
|
// @ts-ignore
|
||||||
import {format as pretty} from 'pretty-format';
|
import {format as pretty} from 'pretty-format';
|
||||||
|
|
||||||
export type Template = Record<string, unknown>;
|
export type Template = Record<string, unknown>;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk = require('chalk');
|
||||||
import type {Global} from '@jest/types';
|
import type {Global} from '@jest/types';
|
||||||
|
// @ts-ignore
|
||||||
import {format as pretty} from 'pretty-format';
|
import {format as pretty} from 'pretty-format';
|
||||||
|
|
||||||
type TemplateData = Global.TemplateData;
|
type TemplateData = Global.TemplateData;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
import type {Jest} from '@jest/environment';
|
import type {Jest} from '@jest/environment';
|
||||||
import type {Global} from '@jest/types';
|
import type {Global} from '@jest/types';
|
||||||
|
// @ts-ignore
|
||||||
import importedExpect = require('expect');
|
import importedExpect = require('expect');
|
||||||
|
|
||||||
export declare const jest: Jest;
|
export declare const jest: Jest;
|
||||||
|
|
|
@ -60,6 +60,7 @@ export default class HasteFS {
|
||||||
}
|
}
|
||||||
|
|
||||||
*getAbsoluteFileIterator(): Iterable<Config.Path> {
|
*getAbsoluteFileIterator(): Iterable<Config.Path> {
|
||||||
|
// @ts-ignore
|
||||||
for (const file of this.getFileIterator()) {
|
for (const file of this.getFileIterator()) {
|
||||||
yield fastPath.resolve(this._rootDir, file);
|
yield fastPath.resolve(this._rootDir, file);
|
||||||
}
|
}
|
||||||
|
@ -70,6 +71,7 @@ export default class HasteFS {
|
||||||
pattern = new RegExp(pattern);
|
pattern = new RegExp(pattern);
|
||||||
}
|
}
|
||||||
const files = [];
|
const files = [];
|
||||||
|
// @ts-ignore
|
||||||
for (const file of this.getAbsoluteFileIterator()) {
|
for (const file of this.getAbsoluteFileIterator()) {
|
||||||
if (pattern.test(file)) {
|
if (pattern.test(file)) {
|
||||||
files.push(file);
|
files.push(file);
|
||||||
|
@ -85,6 +87,7 @@ export default class HasteFS {
|
||||||
const files = new Set<string>();
|
const files = new Set<string>();
|
||||||
const matcher = globsToMatcher(globs);
|
const matcher = globsToMatcher(globs);
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
for (const file of this.getAbsoluteFileIterator()) {
|
for (const file of this.getAbsoluteFileIterator()) {
|
||||||
const filePath = root ? fastPath.relative(root, file) : file;
|
const filePath = root ? fastPath.relative(root, file) : file;
|
||||||
if (matcher(replacePathSepForGlob(filePath))) {
|
if (matcher(replacePathSepForGlob(filePath))) {
|
||||||
|
|
|
@ -184,6 +184,7 @@ export default class ModuleMap implements IModuleMap<SerializableModuleMap> {
|
||||||
const previousSet = relativePathSet;
|
const previousSet = relativePathSet;
|
||||||
const duplicates = new Map();
|
const duplicates = new Map();
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
for (const [relativePath, type] of previousSet) {
|
for (const [relativePath, type] of previousSet) {
|
||||||
const duplicatePath = fastPath.resolve(this._raw.rootDir, relativePath);
|
const duplicatePath = fastPath.resolve(this._raw.rootDir, relativePath);
|
||||||
duplicates.set(duplicatePath, type);
|
duplicates.set(duplicatePath, type);
|
||||||
|
|
|
@ -274,6 +274,7 @@ export = async function watchmanCrawl(options: CrawlerOptions): Promise<{
|
||||||
throw clientError;
|
throw clientError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
for (const [watchRoot, response] of results) {
|
for (const [watchRoot, response] of results) {
|
||||||
const fsRoot = normalizePathSep(watchRoot);
|
const fsRoot = normalizePathSep(watchRoot);
|
||||||
const relativeFsRoot = fastPath.relative(rootDir, fsRoot);
|
const relativeFsRoot = fastPath.relative(rootDir, fsRoot);
|
||||||
|
|
|
@ -676,11 +676,13 @@ export default class HasteMap extends EventEmitter {
|
||||||
filesToProcess = changedFiles;
|
filesToProcess = changedFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
for (const [relativeFilePath, fileMetadata] of removedFiles) {
|
for (const [relativeFilePath, fileMetadata] of removedFiles) {
|
||||||
this._recoverDuplicates(hasteMap, relativeFilePath, fileMetadata[H.ID]);
|
this._recoverDuplicates(hasteMap, relativeFilePath, fileMetadata[H.ID]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
// @ts-ignore
|
||||||
for (const relativeFilePath of filesToProcess.keys()) {
|
for (const relativeFilePath of filesToProcess.keys()) {
|
||||||
if (
|
if (
|
||||||
this._options.skipPackageJson &&
|
this._options.skipPackageJson &&
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {FailedAssertion} from '@jest/test-result';
|
import type {FailedAssertion} from '@jest/test-result';
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
|
|
||||||
function messageFormatter({error, message, passed}: Options) {
|
function messageFormatter({error, message, passed}: Options) {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
|
|
||||||
export default function isError(
|
export default function isError(
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
import type {AssertionError} from 'assert';
|
import type {AssertionError} from 'assert';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
|
// @ts-ignore
|
||||||
import expect = require('expect');
|
import expect = require('expect');
|
||||||
import type CallTracker from './jasmine/CallTracker';
|
import type CallTracker from './jasmine/CallTracker';
|
||||||
import type Env from './jasmine/Env';
|
import type Env from './jasmine/Env';
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {promisify} from 'util';
|
||||||
import {setFlagsFromString} from 'v8';
|
import {setFlagsFromString} from 'v8';
|
||||||
import {runInNewContext} from 'vm';
|
import {runInNewContext} from 'vm';
|
||||||
import {isPrimitive} from 'jest-get-type';
|
import {isPrimitive} from 'jest-get-type';
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
|
|
||||||
const tick = promisify(setImmediate);
|
const tick = promisify(setImmediate);
|
||||||
|
|
|
@ -14,12 +14,14 @@ import {
|
||||||
DIFF_INSERT,
|
DIFF_INSERT,
|
||||||
Diff,
|
Diff,
|
||||||
DiffOptions as ImportDiffOptions,
|
DiffOptions as ImportDiffOptions,
|
||||||
|
// @ts-ignore
|
||||||
diff as diffDefault,
|
diff as diffDefault,
|
||||||
diffStringsRaw,
|
diffStringsRaw,
|
||||||
diffStringsUnified,
|
diffStringsUnified,
|
||||||
} from 'jest-diff';
|
} from 'jest-diff';
|
||||||
import {getType, isPrimitive} from 'jest-get-type';
|
import {getType, isPrimitive} from 'jest-get-type';
|
||||||
import {
|
import {
|
||||||
|
// @ts-ignore
|
||||||
format as prettyFormat,
|
format as prettyFormat,
|
||||||
plugins as prettyFormatPlugins,
|
plugins as prettyFormatPlugins,
|
||||||
} from 'pretty-format';
|
} from 'pretty-format';
|
||||||
|
|
|
@ -14,6 +14,7 @@ import micromatch = require('micromatch');
|
||||||
import slash = require('slash');
|
import slash = require('slash');
|
||||||
import StackUtils = require('stack-utils');
|
import StackUtils = require('stack-utils');
|
||||||
import type {Config, TestResult} from '@jest/types';
|
import type {Config, TestResult} from '@jest/types';
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
import type {Frame} from './types';
|
import type {Frame} from './types';
|
||||||
|
|
||||||
|
|
|
@ -653,6 +653,7 @@ export class ModuleMocker {
|
||||||
const mockImpl = mockConfig.specificMockImpls.length
|
const mockImpl = mockConfig.specificMockImpls.length
|
||||||
? mockConfig.specificMockImpls.shift()
|
? mockConfig.specificMockImpls.shift()
|
||||||
: mockConfig.mockImpl;
|
: mockConfig.mockImpl;
|
||||||
|
// @ts-ignore
|
||||||
return mockImpl && mockImpl.apply(this, arguments);
|
return mockImpl && mockImpl.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -663,10 +664,12 @@ export class ModuleMocker {
|
||||||
specificMockImpl = mockConfig.mockImpl;
|
specificMockImpl = mockConfig.mockImpl;
|
||||||
}
|
}
|
||||||
if (specificMockImpl) {
|
if (specificMockImpl) {
|
||||||
|
// @ts-ignore
|
||||||
return specificMockImpl.apply(this, arguments);
|
return specificMockImpl.apply(this, arguments);
|
||||||
}
|
}
|
||||||
// Otherwise use prototype implementation
|
// Otherwise use prototype implementation
|
||||||
if (f._protoImpl) {
|
if (f._protoImpl) {
|
||||||
|
// @ts-ignore
|
||||||
return f._protoImpl.apply(this, arguments);
|
return f._protoImpl.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -456,6 +456,7 @@ export default class CoverageReporter extends BaseReporter {
|
||||||
const converter = v8toIstanbul(
|
const converter = v8toIstanbul(
|
||||||
res.url,
|
res.url,
|
||||||
fileTransform?.wrapperLength ?? 0,
|
fileTransform?.wrapperLength ?? 0,
|
||||||
|
// @ts-ignore
|
||||||
fileTransform && sourcemapContent
|
fileTransform && sourcemapContent
|
||||||
? {
|
? {
|
||||||
originalSource: fileTransform.originalCode,
|
originalSource: fileTransform.originalCode,
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {sync as resolveSync} from 'resolve';
|
||||||
import {
|
import {
|
||||||
Options as ResolveExportsOptions,
|
Options as ResolveExportsOptions,
|
||||||
resolve as resolveExports,
|
resolve as resolveExports,
|
||||||
|
// @ts-ignore
|
||||||
} from 'resolve.exports';
|
} from 'resolve.exports';
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -49,6 +49,7 @@ export type {
|
||||||
export default class TestRunner {
|
export default class TestRunner {
|
||||||
private readonly _globalConfig: Config.GlobalConfig;
|
private readonly _globalConfig: Config.GlobalConfig;
|
||||||
private readonly _context: TestRunnerContext;
|
private readonly _context: TestRunnerContext;
|
||||||
|
// @ts-ignore
|
||||||
private readonly eventEmitter = new Emittery<TestEvents>();
|
private readonly eventEmitter = new Emittery<TestEvents>();
|
||||||
readonly __PRIVATE_UNSTABLE_API_supportsEventEmitters__: boolean = true;
|
readonly __PRIVATE_UNSTABLE_API_supportsEventEmitters__: boolean = true;
|
||||||
|
|
||||||
|
@ -224,7 +225,9 @@ export default class TestRunner {
|
||||||
});
|
});
|
||||||
|
|
||||||
const onInterrupt = new Promise((_, reject) => {
|
const onInterrupt = new Promise((_, reject) => {
|
||||||
|
// @ts-ignore
|
||||||
watcher.on('change', state => {
|
watcher.on('change', state => {
|
||||||
|
// @ts-ignore
|
||||||
if (state.interrupted) {
|
if (state.interrupted) {
|
||||||
reject(new CancelRun());
|
reject(new CancelRun());
|
||||||
}
|
}
|
||||||
|
@ -272,6 +275,7 @@ export default class TestRunner {
|
||||||
eventName: Name,
|
eventName: Name,
|
||||||
listener: (eventData: TestEvents[Name]) => void | Promise<void>,
|
listener: (eventData: TestEvents[Name]) => void | Promise<void>,
|
||||||
): Emittery.UnsubscribeFn {
|
): Emittery.UnsubscribeFn {
|
||||||
|
// @ts-ignore
|
||||||
return this.eventEmitter.on(eventName, listener);
|
return this.eventEmitter.on(eventName, listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
import Emittery = require('emittery');
|
import Emittery = require('emittery');
|
||||||
import type {JestEnvironment} from '@jest/environment';
|
import type {JestEnvironment} from '@jest/environment';
|
||||||
import type {
|
import type {
|
||||||
|
@ -54,7 +55,7 @@ export type TestRunnerSerializedContext = {
|
||||||
|
|
||||||
// TODO: Should live in `@jest/core` or `jest-watcher`
|
// TODO: Should live in `@jest/core` or `jest-watcher`
|
||||||
type WatcherState = {interrupted: boolean};
|
type WatcherState = {interrupted: boolean};
|
||||||
export interface TestWatcher extends Emittery<{change: WatcherState}> {
|
export interface TestWatcher extends Emittery {
|
||||||
state: WatcherState;
|
state: WatcherState;
|
||||||
setState(state: WatcherState): void;
|
setState(state: WatcherState): void;
|
||||||
isInterrupted(): boolean;
|
isInterrupted(): boolean;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
import * as nativeModule from 'module';
|
import * as 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';
|
||||||
|
|
|
@ -34,6 +34,7 @@ import {
|
||||||
getLabelPrinter,
|
getLabelPrinter,
|
||||||
matcherHint,
|
matcherHint,
|
||||||
} from 'jest-matcher-utils';
|
} from 'jest-matcher-utils';
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
import {
|
import {
|
||||||
aBackground2,
|
aBackground2,
|
||||||
|
|
|
@ -12,6 +12,7 @@ import naturalCompare = require('natural-compare');
|
||||||
import type {Config} from '@jest/types';
|
import type {Config} from '@jest/types';
|
||||||
import {
|
import {
|
||||||
OptionsReceived as PrettyFormatOptions,
|
OptionsReceived as PrettyFormatOptions,
|
||||||
|
// @ts-ignore
|
||||||
format as prettyFormat,
|
format as prettyFormat,
|
||||||
} from 'pretty-format';
|
} from 'pretty-format';
|
||||||
import {getSerializers} from './plugins';
|
import {getSerializers} from './plugins';
|
||||||
|
|
|
@ -10,6 +10,7 @@ import type {CoverageMap, CoverageMapData} from 'istanbul-lib-coverage';
|
||||||
import type {ConsoleBuffer} from '@jest/console';
|
import type {ConsoleBuffer} from '@jest/console';
|
||||||
import type {Config, TestResult, TransformTypes} from '@jest/types';
|
import type {Config, TestResult, TransformTypes} from '@jest/types';
|
||||||
import type {FS as HasteFS, ModuleMap} from 'jest-haste-map';
|
import type {FS as HasteFS, ModuleMap} from 'jest-haste-map';
|
||||||
|
// @ts-ignore
|
||||||
import type Resolver from 'jest-resolve';
|
import type Resolver from 'jest-resolve';
|
||||||
|
|
||||||
export interface RuntimeTransformResult extends TransformTypes.TransformResult {
|
export interface RuntimeTransformResult extends TransformTypes.TransformResult {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
import chalk = require('chalk');
|
import chalk = require('chalk');
|
||||||
import leven from 'leven';
|
import leven from 'leven';
|
||||||
|
// @ts-ignore
|
||||||
import {format as prettyFormat} from 'pretty-format';
|
import {format as prettyFormat} from 'pretty-format';
|
||||||
|
|
||||||
const BULLET: string = chalk.bold('\u25cf');
|
const BULLET: string = chalk.bold('\u25cf');
|
||||||
|
|
|
@ -61,7 +61,7 @@ export default class ExperimentalWorker implements WorkerInterface {
|
||||||
initialize(): void {
|
initialize(): void {
|
||||||
this._worker = new Worker(path.resolve(__dirname, './threadChild.js'), {
|
this._worker = new Worker(path.resolve(__dirname, './threadChild.js'), {
|
||||||
eval: false,
|
eval: false,
|
||||||
// @ts-expect-error: added in newer versions
|
// @ts-ignore
|
||||||
resourceLimits: this._options.resourceLimits,
|
resourceLimits: this._options.resourceLimits,
|
||||||
stderr: true,
|
stderr: true,
|
||||||
stdout: true,
|
stdout: true,
|
||||||
|
|
Loading…
Reference in New Issue