Skip to content

Commit 3c2b71e

Browse files
committed
4.4
1 parent fe11967 commit 3c2b71e

16 files changed

Lines changed: 26 additions & 26 deletions

File tree

packages/jest-changed-files/src/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const findChangedFilesUsingCommand = async (
1919

2020
try {
2121
result = await execa('git', args, {cwd});
22-
} catch (e) {
22+
} catch (e: any) {
2323
// TODO: Should we keep the original `message`?
2424
e.message = e.stderr;
2525

packages/jest-changed-files/src/hg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const adapter: SCMAdapter = {
3232

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

packages/jest-each/src/bind.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default <EachCallback extends Global.TestCallback>(
5050
timeout,
5151
),
5252
);
53-
} catch (e) {
53+
} catch (e: any) {
5454
const error = new ErrorWithStack(e.message, eachBind);
5555
return cb(title, () => {
5656
throw error;

packages/jest-haste-map/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ export default class HasteMap extends EventEmitter {
793793

794794
try {
795795
return crawl(crawlerOptions).catch(retry);
796-
} catch (error) {
796+
} catch (error: any) {
797797
return retry(error);
798798
}
799799
}

packages/jest-haste-map/src/worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function worker(data: WorkerMessage): Promise<WorkerMetadata> {
6060
id = fileData.name;
6161
module = [relativeFilePath, H.PACKAGE];
6262
}
63-
} catch (err) {
63+
} catch (err: any) {
6464
throw new Error(`Cannot parse ${filePath} as JSON: ${err.message}`);
6565
}
6666
} else if (!blacklist.has(filePath.substr(filePath.lastIndexOf('.')))) {

packages/jest-leak-detector/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class {
3333
try {
3434
// eslint-disable-next-line import/no-extraneous-dependencies
3535
weak = require('weak-napi');
36-
} catch (err) {
36+
} catch (err: any) {
3737
if (!err || err.code !== 'MODULE_NOT_FOUND') {
3838
throw err;
3939
}

packages/jest-resolve/src/defaultResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function statSyncCached(path: string): IPathType {
7474
let stat;
7575
try {
7676
stat = fs.statSync(path);
77-
} catch (e) {
77+
} catch (e: any) {
7878
if (!(e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))) {
7979
throw e;
8080
}

packages/jest-transform/src/ScriptTransformer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ class ScriptTransformer {
611611
originalCode: content,
612612
sourceMapPath,
613613
};
614-
} catch (e) {
614+
} catch (e: any) {
615615
throw handlePotentialSyntaxError(e);
616616
}
617617
}
@@ -654,7 +654,7 @@ class ScriptTransformer {
654654
originalCode: content,
655655
sourceMapPath,
656656
};
657-
} catch (e) {
657+
} catch (e: any) {
658658
throw handlePotentialSyntaxError(e);
659659
}
660660
}
@@ -896,7 +896,7 @@ function readCodeCacheFile(cachePath: Config.Path): string | null {
896896
const writeCacheFile = (cachePath: Config.Path, fileData: string) => {
897897
try {
898898
writeFileAtomic(cachePath, fileData, {encoding: 'utf8', fsync: false});
899-
} catch (e) {
899+
} catch (e: any) {
900900
if (cacheWriteErrorSafeToIgnore(e, cachePath)) {
901901
return;
902902
}
@@ -933,7 +933,7 @@ const readCacheFile = (cachePath: Config.Path): string | null => {
933933
let fileData;
934934
try {
935935
fileData = fs.readFileSync(cachePath, 'utf8');
936-
} catch (e) {
936+
} catch (e: any) {
937937
e.message =
938938
'jest: failed to read cache file: ' +
939939
cachePath +

packages/jest-util/src/createDirectory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {Config} from '@jest/types';
1111
export default function createDirectory(path: Config.Path): void {
1212
try {
1313
fs.mkdirSync(path, {recursive: true});
14-
} catch (e) {
14+
} catch (e: any) {
1515
if (e.code !== 'EEXIST') {
1616
throw e;
1717
}

packages/jest-util/src/createProcessObject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function (): NodeJS.Process {
8989
try {
9090
// This fails on Node 12, but it's already set to 'process'
9191
newProcess[Symbol.toStringTag] = 'process';
92-
} catch (e) {
92+
} catch (e: any) {
9393
// Make sure it's actually set instead of potentially ignoring errors
9494
if (newProcess[Symbol.toStringTag] !== 'process') {
9595
e.message =

0 commit comments

Comments
 (0)