Skip to content

Commit

Permalink
4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 11, 2021
1 parent fe11967 commit 3c2b71e
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/jest-changed-files/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const findChangedFilesUsingCommand = async (

try {
result = await execa('git', args, {cwd});
} catch (e) {
} catch (e: any) {
// TODO: Should we keep the original `message`?
e.message = e.stderr;

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-changed-files/src/hg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const adapter: SCMAdapter = {

try {
result = await execa('hg', args, {cwd, env});
} catch (e) {
} catch (e: any) {
// TODO: Should we keep the original `message`?
e.message = e.stderr;

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-each/src/bind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default <EachCallback extends Global.TestCallback>(
timeout,
),
);
} catch (e) {
} catch (e: any) {
const error = new ErrorWithStack(e.message, eachBind);
return cb(title, () => {
throw error;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-haste-map/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ export default class HasteMap extends EventEmitter {

try {
return crawl(crawlerOptions).catch(retry);
} catch (error) {
} catch (error: any) {
return retry(error);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-haste-map/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function worker(data: WorkerMessage): Promise<WorkerMetadata> {
id = fileData.name;
module = [relativeFilePath, H.PACKAGE];
}
} catch (err) {
} catch (err: any) {
throw new Error(`Cannot parse ${filePath} as JSON: ${err.message}`);
}
} else if (!blacklist.has(filePath.substr(filePath.lastIndexOf('.')))) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-leak-detector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class {
try {
// eslint-disable-next-line import/no-extraneous-dependencies
weak = require('weak-napi');
} catch (err) {
} catch (err: any) {
if (!err || err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-resolve/src/defaultResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function statSyncCached(path: string): IPathType {
let stat;
try {
stat = fs.statSync(path);
} catch (e) {
} catch (e: any) {
if (!(e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))) {
throw e;
}
Expand Down
8 changes: 4 additions & 4 deletions packages/jest-transform/src/ScriptTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class ScriptTransformer {
originalCode: content,
sourceMapPath,
};
} catch (e) {
} catch (e: any) {
throw handlePotentialSyntaxError(e);
}
}
Expand Down Expand Up @@ -654,7 +654,7 @@ class ScriptTransformer {
originalCode: content,
sourceMapPath,
};
} catch (e) {
} catch (e: any) {
throw handlePotentialSyntaxError(e);
}
}
Expand Down Expand Up @@ -896,7 +896,7 @@ function readCodeCacheFile(cachePath: Config.Path): string | null {
const writeCacheFile = (cachePath: Config.Path, fileData: string) => {
try {
writeFileAtomic(cachePath, fileData, {encoding: 'utf8', fsync: false});
} catch (e) {
} catch (e: any) {
if (cacheWriteErrorSafeToIgnore(e, cachePath)) {
return;
}
Expand Down Expand Up @@ -933,7 +933,7 @@ const readCacheFile = (cachePath: Config.Path): string | null => {
let fileData;
try {
fileData = fs.readFileSync(cachePath, 'utf8');
} catch (e) {
} catch (e: any) {
e.message =
'jest: failed to read cache file: ' +
cachePath +
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-util/src/createDirectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {Config} from '@jest/types';
export default function createDirectory(path: Config.Path): void {
try {
fs.mkdirSync(path, {recursive: true});
} catch (e) {
} catch (e: any) {
if (e.code !== 'EEXIST') {
throw e;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-util/src/createProcessObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function (): NodeJS.Process {
try {
// This fails on Node 12, but it's already set to 'process'
newProcess[Symbol.toStringTag] = 'process';
} catch (e) {
} catch (e: any) {
// Make sure it's actually set instead of potentially ignoring errors
if (newProcess[Symbol.toStringTag] !== 'process') {
e.message =
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-util/src/requireOrImportModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function requireOrImportModule<T>(
return requiredModule;
}
return interopRequireDefault(requiredModule).default;
} catch (error) {
} catch (error: any) {
if (error.code === 'ERR_REQUIRE_ESM') {
try {
const moduleUrl = pathToFileURL(filePath);
Expand All @@ -44,7 +44,7 @@ export default async function requireOrImportModule<T>(
}

return importedModule.default;
} catch (innerError) {
} catch (innerError: any) {
if (innerError.message === 'Not supported') {
throw new Error(
`Jest: Your version of Node does not support dynamic import - please enable it or use a .cjs file extension for file ${filePath}`,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-util/src/tryRealpath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {Config} from '@jest/types';
export default function tryRealpath(path: Config.Path): Config.Path {
try {
path = realpathSync.native(path);
} catch (error) {
} catch (error: any) {
if (error.code !== 'ENOENT') {
throw error;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-worker/src/workers/processChild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function execFunction(

try {
result = fn.apply(ctx, args);
} catch (err) {
} catch (err: any) {
onError(err);

return;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-worker/src/workers/threadChild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function execFunction(

try {
result = fn.apply(ctx, args);
} catch (err) {
} catch (err: any) {
onError(err);

return;
Expand Down
4 changes: 2 additions & 2 deletions packages/pretty-format/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function printPlugin(
},
config.colors,
);
} catch (error) {
} catch (error: any) {
throw new PrettyFormatPluginError(error.message, error.stack);
}
if (typeof printed !== 'string') {
Expand All @@ -341,7 +341,7 @@ function findPlugin(plugins: Plugins, val: unknown) {
if (plugins[p].test(val)) {
return plugins[p];
}
} catch (error) {
} catch (error: any) {
throw new PrettyFormatPluginError(error.message, error.stack);
}
}
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21198,22 +21198,22 @@ react-native@0.64.0:
linkType: hard

"typescript@*, typescript@^4.0.2, typescript@^4.0.3":
version: 4.3.5
resolution: "typescript@npm:4.3.5"
version: 4.4.3
resolution: "typescript@npm:4.4.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: d9a8e78d72dd19896e6bfa73ab2a0fcea6eca2700d1d6e7c33f67a970af54a3e0fed8f715a8c4e6a0ff7fc0995067b394b2003518ab0aa84cd396377e54b760c
checksum: 0da3a2a96506240557512ee49ff37a882c49c8c803444b90b98984e50d5d2e526885d57cd0f75225525413630b0e070e0e9ab4538485852fa1c158a6e7925cbb
languageName: node
linkType: hard

"typescript@patch:typescript@*#builtin<compat/typescript>, typescript@patch:typescript@^4.0.2#builtin<compat/typescript>, typescript@patch:typescript@^4.0.3#builtin<compat/typescript>":
version: 4.3.5
resolution: "typescript@patch:typescript@npm%3A4.3.5#builtin<compat/typescript>::version=4.3.5&hash=8133ad"
version: 4.4.3
resolution: "typescript@patch:typescript@npm%3A4.4.3#builtin<compat/typescript>::version=4.4.3&hash=8133ad"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 7e9040a3ee8b62c9f499fdaeeb2ea143c079e88fadeba562ce2f7ee878cf3eba9cf6097bf8a4ead0de4b35582f71a4866d9f475af9b064fde430d55d9fc6aaac
checksum: d328b850f6e56d424dfda4b2bf2950fcc2f8bb21446f0eb9fe2d4b7a4f9b678a4f17204a31f6ad2dfb2419a69e508683d938491cecc2650aedde9423e5489825
languageName: node
linkType: hard

Expand Down

0 comments on commit 3c2b71e

Please sign in to comment.