Skip to content

Commit e98d044

Browse files
authored
chore: update to typescript@4.5 (#11142)
1 parent 5587740 commit e98d044

28 files changed

Lines changed: 63 additions & 66 deletions

File tree

.eslintrc.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ module.exports = {
3535
rules: {
3636
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
3737
'@typescript-eslint/ban-types': 'error',
38-
'@typescript-eslint/no-implicit-any-catch': [
39-
'error',
40-
{allowExplicitAny: true},
41-
],
4238
'@typescript-eslint/no-unused-vars': [
4339
'error',
4440
{argsIgnorePattern: '^_'},

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
run: yarn build
6060
- name: test typings
6161
run: yarn test-types
62-
- name: verify TypeScript@3.8 compatibility
62+
- name: verify TypeScript@4.2 compatibility
6363
run: yarn verify-old-ts
6464
- name: verify Yarn PnP compatibility
6565
run: yarn verify-pnp

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
### Chore & Maintenance
1111

1212
- `[*]` [**BREAKING**] Drop support for Node v10 and v15 and target first LTS `16.13.0` ([#12220](https://github.com/facebook/jest/pull/12220))
13+
- `[*]` [**BREAKING**] Drop support for `typescript@3.8`, minimum version is now `4.2` ([#11142](https://github.com/facebook/jest/pull/11142))
1314
- `[@jest/core]` Use `index.ts` instead of `jest.ts` as main export ([#12329](https://github.com/facebook/jest/pull/12329))
1415
- `[jest]` Use `index.ts` instead of `jest.ts` as main export ([#12329](https://github.com/facebook/jest/pull/12329))
1516

e2e/__tests__/resolveConditions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ onNodeVersions('>=12.16.0', () => {
2121
});
2222
try {
2323
expect(exitCode).toBe(0);
24-
} catch (error: unknown) {
24+
} catch (error) {
2525
console.log(`Test failed on iteration ${i + 1}`);
2626
throw error;
2727
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@jest/globals": "workspace:*",
1414
"@jest/test-utils": "workspace:*",
1515
"@tsconfig/node12": "^1.0.9",
16-
"@tsd/typescript": "~4.1.5",
16+
"@tsd/typescript": "~4.5.5",
1717
"@types/babel__core": "^7.0.0",
1818
"@types/babel__generator": "^7.0.0",
1919
"@types/babel__template": "^7.0.0",
@@ -55,7 +55,7 @@
5555
"jest-changed-files": "workspace:*",
5656
"jest-junit": "^13.0.0",
5757
"jest-mock": "workspace:*",
58-
"jest-runner-tsd": "^2.0.0",
58+
"jest-runner-tsd": "^3.0.0",
5959
"jest-silent-reporter": "^0.5.0",
6060
"jest-snapshot": "workspace:*",
6161
"jest-watch-typeahead": "^0.6.0",
@@ -79,7 +79,7 @@
7979
"tempy": "^1.0.0",
8080
"throat": "^6.0.1",
8181
"ts-node": "^9.0.0",
82-
"type-fest": "^1.1.1",
82+
"type-fest": "^2.11.2",
8383
"typescript": "^4.0.2",
8484
"which": "^2.0.1"
8585
},

packages/expect/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"devDependencies": {
2828
"@jest/test-utils": "^27.5.1",
29-
"@tsd/typescript": "~4.1.5",
29+
"@tsd/typescript": "~4.5.5",
3030
"chalk": "^4.0.0",
3131
"fast-check": "^2.0.0",
3232
"immutable": "^4.0.0",

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: unknown) {
46+
} catch (e) {
4747
return e;
4848
}
4949
return null;

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: unknown) {
110+
} catch (e) {
111111
thrown = getThrown(e);
112112
}
113113
}

packages/jest-circus/src/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const _callCircusHook = async ({
157157
timeout,
158158
});
159159
await dispatch({describeBlock, hook, name: 'hook_success', test});
160-
} catch (error: unknown) {
160+
} catch (error) {
161161
await dispatch({describeBlock, error, hook, name: 'hook_failure', test});
162162
}
163163
};
@@ -180,7 +180,7 @@ const _callCircusTest = async (
180180
timeout,
181181
});
182182
await dispatch({name: 'test_fn_success', test});
183-
} catch (error: unknown) {
183+
} catch (error) {
184184
await dispatch({error, name: 'test_fn_failure', test});
185185
}
186186
};

packages/jest-circus/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// Used as type
99
import type {Circus} from '@jest/types';
10-
import expect = require('expect');
10+
import type expect = require('expect');
1111

1212
export const STATE_SYM = Symbol(
1313
'JEST_STATE_SYMBOL',

0 commit comments

Comments
 (0)