Skip to content

Commit 6e3798b

Browse files
committed
4.4
1 parent 8e809c6 commit 6e3798b

53 files changed

Lines changed: 82 additions & 80 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

e2e/__tests__/detectOpenHandles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import runJest, {runContinuous} from '../runJest';
1111

1212
try {
1313
require('async_hooks');
14-
} catch (e) {
14+
} catch (e: any) {
1515
if (e.code === 'MODULE_NOT_FOUND') {
1616
// eslint-disable-next-line jest/no-focused-tests
1717
fit('skip test for unsupported nodes', () => {

e2e/__tests__/jsonReporter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('JSON Reporter', () => {
3030

3131
try {
3232
jsonResult = JSON.parse(testOutput);
33-
} catch (err) {
33+
} catch (err: any) {
3434
throw new Error(
3535
`Can't parse the JSON result from ${outputFileName}, ${err.toString()}`,
3636
);
@@ -71,7 +71,7 @@ describe('JSON Reporter', () => {
7171

7272
try {
7373
jsonResult = JSON.parse(result.stdout);
74-
} catch (err) {
74+
} catch (err: any) {
7575
throw new Error(
7676
"Can't parse the JSON result from stdout" + err.toString(),
7777
);

e2e/__tests__/resolveConditions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ onNodeVersions('>=12.16.0', () => {
2626
});
2727
try {
2828
expect(exitCode).toBe(0);
29-
} catch (error) {
29+
} catch (error: any) {
3030
console.log(`Test failed on iteration ${i + 1}`);
3131
throw error;
3232
}

e2e/__tests__/testRetries.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('Test Retries', () => {
5050

5151
try {
5252
jsonResult = JSON.parse(testOutput);
53-
} catch (err) {
53+
} catch (err: any) {
5454
throw new Error(
5555
`Can't parse the JSON result from ${outputFileName}, ${err.toString()}`,
5656
);
@@ -81,7 +81,7 @@ describe('Test Retries', () => {
8181

8282
try {
8383
jsonResult = JSON.parse(testOutput);
84-
} catch (err) {
84+
} catch (err: any) {
8585
throw new Error(
8686
`Can't parse the JSON result from ${outputFileName}, ${err.toString()}`,
8787
);
@@ -112,7 +112,7 @@ describe('Test Retries', () => {
112112

113113
try {
114114
jsonResult = JSON.parse(testOutput);
115-
} catch (err) {
115+
} catch (err: any) {
116116
throw new Error(
117117
`Can't parse the JSON result from ${outputFileName}, ${err.toString()}`,
118118
);

e2e/runJest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const json = function (
144144
...result,
145145
json: JSON.parse(result.stdout || ''),
146146
};
147-
} catch (e) {
147+
} catch (e: any) {
148148
throw new Error(
149149
`
150150
Can't parse JSON.

packages/expect/src/__tests__/isError.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('isError', () => {
4343
testErrorFromDifferentContext((win: Window) => {
4444
try {
4545
win.document.querySelectorAll('');
46-
} catch (e) {
46+
} catch (e: any) {
4747
return e;
4848
}
4949
return null;

packages/expect/src/__tests__/stacktrace.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jestExpect.extend({
3333
it('stack trace points to correct location when using matchers', () => {
3434
try {
3535
jestExpect(true).toBe(false);
36-
} catch (error) {
36+
} catch (error: any) {
3737
expect(error.stack).toContain('stacktrace.test.ts:35');
3838
}
3939
});
@@ -43,7 +43,7 @@ it('stack trace points to correct location when using nested matchers', () => {
4343
jestExpect(true).toMatchPredicate((value: unknown) => {
4444
jestExpect(value).toBe(false);
4545
});
46-
} catch (error) {
46+
} catch (error: any) {
4747
expect(error.stack).toContain('stacktrace.test.ts:44');
4848
}
4949
});
@@ -59,7 +59,7 @@ it('stack trace points to correct location when throwing from a custom matcher',
5959

6060
foo();
6161
}).toCustomMatch('bar');
62-
} catch (error) {
62+
} catch (error: any) {
6363
expect(error.stack).toContain('stacktrace.test.ts:57');
6464
}
6565
});

packages/expect/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ const makeThrowingMatcher = (
349349

350350
return processResult(syncResult);
351351
}
352-
} catch (error) {
352+
} catch (error: any) {
353353
return handleError(error);
354354
}
355355
};

packages/expect/src/toThrowMatchers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const createMatcher = (
107107
} else {
108108
try {
109109
received();
110-
} catch (e) {
110+
} catch (e: any) {
111111
thrown = getThrown(e);
112112
}
113113
}

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

0 commit comments

Comments
 (0)