Skip to content

Commit

Permalink
chore: upgrade TypeScript to v5 (#14155)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 24, 2023
1 parent 8403030 commit 6ffa48d
Show file tree
Hide file tree
Showing 23 changed files with 85 additions and 103 deletions.
2 changes: 1 addition & 1 deletion e2e/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const linkJestPackage = (packageName: string, cwd: string) => {
};

export const makeTemplate =
(str: string): ((values?: Array<unknown>) => string) =>
(str: string): ((values?: Array<string>) => string) =>
(values = []) =>
str.replace(/\$(\d+)/g, (_match, number) => {
if (!Array.isArray(values)) {
Expand Down
4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/testFailingJasmine.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ FAIL __tests__/worksWithConcurrentMode.test.js
15 | });
16 |
at Function.failing (../../packages/jest-jasmine2/build/jasmineAsyncInstall.js:176:11)
at Function.failing (../../packages/jest-jasmine2/build/jasmineAsyncInstall.js:175:11)
at Suite.failing (__tests__/worksWithConcurrentMode.test.js:13:17)
at Object.describe (__tests__/worksWithConcurrentMode.test.js:8:1)
Expand Down Expand Up @@ -80,7 +80,7 @@ FAIL __tests__/worksWithConcurrentOnlyMode.test.js
15 | });
16 |
at Function.failing (../../packages/jest-jasmine2/build/jasmineAsyncInstall.js:176:11)
at Function.failing (../../packages/jest-jasmine2/build/jasmineAsyncInstall.js:175:11)
at Suite.failing (__tests__/worksWithConcurrentOnlyMode.test.js:13:22)
at Object.describe (__tests__/worksWithConcurrentOnlyMode.test.js:8:1)
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"core-js": "^3.2.1",
"rxjs": "^7.5.5",
"tslib": "^2.0.0",
"typescript": "^4.8.2",
"typescript": "^5.0.4",
"zone.js": "~0.11.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/expect-extend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"babel-jest": "workspace:^",
"expect": "workspace:^",
"jest": "workspace:^",
"typescript": "^4.8.2"
"typescript": "^5.0.4"
},
"scripts": {
"test": "jest"
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"react": "18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.8.2"
"typescript": "^5.0.4"
},
"devDependencies": {
"@babel/core": "^7.11.6",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"@jest/globals": "workspace:^",
"@jest/test-utils": "workspace:^",
"@lerna-lite/cli": "^1.11.3",
"@microsoft/api-extractor": "^7.33.4",
"@microsoft/api-extractor": "^7.35.0",
"@tsconfig/node14": "^1.0.3",
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"@types/babel__core": "^7.1.14",
"@types/babel__generator": "^7.0.0",
"@types/babel__template": "^7.0.2",
Expand Down Expand Up @@ -80,7 +80,7 @@
"strip-json-comments": "^3.1.1",
"tempy": "^1.0.0",
"ts-node": "^10.5.0",
"typescript": "^4.8.2",
"typescript": "^5.0.4",
"which": "^3.0.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/expect-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"jest-get-type": "workspace:^"
},
"devDependencies": {
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"immutable": "^4.0.0",
"jest-matcher-utils": "workspace:^",
"tsd-lite": "^0.7.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"devDependencies": {
"@fast-check/jest": "^1.3.0",
"@jest/test-utils": "workspace:^",
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"chalk": "^4.0.0",
"immutable": "^4.0.0",
"tsd-lite": "^0.7.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"yargs": "^17.3.1"
},
"devDependencies": {
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"@types/exit": "^0.1.30",
"@types/graceful-fs": "^4.1.3",
"@types/prompts": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@types/parse-json": "^4.0.0",
"semver": "^7.3.5",
"ts-node": "^10.5.0",
"typescript": "^4.8.2"
"typescript": "^5.0.4"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-expect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"jest-snapshot": "workspace:^"
},
"devDependencies": {
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"tsd-lite": "^0.7.0"
},
"engines": {
Expand Down
1 change: 0 additions & 1 deletion packages/jest-jasmine2/src/jasmineAsyncInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ function promisifyLifeCycleFunction(
// didn't return a promise.
const asyncJestLifecycle = function (done: DoneFn) {
const wrappedFn = isGeneratorFn(fn) ? co.wrap(fn) : fn;
// @ts-expect-error: TS thinks `wrappedFn` is a generator function
const returnValue = wrappedFn.call({}, doneFnNoop);

if (isPromise(returnValue)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"jest-util": "workspace:^"
},
"devDependencies": {
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"tsd-lite": "^0.7.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-reporters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@jest/test-utils": "workspace:^",
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"@types/exit": "^0.1.30",
"@types/glob": "^7.1.1",
"@types/graceful-fs": "^4.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-resolve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"slash": "^3.0.0"
},
"devDependencies": {
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"@types/graceful-fs": "^4.1.3",
"@types/pnpapi": "^0.0.2",
"@types/resolve": "^1.20.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"devDependencies": {
"@jest/test-utils": "workspace:^",
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"@types/exit": "^0.1.30",
"@types/graceful-fs": "^4.1.3",
"@types/source-map-support": "^0.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-snapshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@babel/preset-flow": "^7.7.2",
"@babel/preset-react": "^7.12.1",
"@jest/test-utils": "workspace:^",
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"@types/babel__core": "^7.1.14",
"@types/graceful-fs": "^4.1.3",
"@types/natural-compare": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"chalk": "^4.0.0"
},
"devDependencies": {
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"tsd-lite": "^0.7.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"@types/merge-stream": "^1.1.2",
"@types/supports-color": "^8.1.0",
"get-stream": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"jest-cli": "workspace:^"
},
"devDependencies": {
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"tsd-lite": "^0.7.0"
},
"peerDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"esModuleInterop": false,
"isolatedModules": true,
"skipLibCheck": false,
"resolveJsonModule": true
"resolveJsonModule": true,

// TODO: remove for Jest 30
"ignoreDeprecations": "5.0"
}
}
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
"graphql": "^16.3.0",
"graphql-request": "^6.0.0",
"js-yaml": "^4.1.0",
"typescript": "^4.8.2"
"typescript": "^5.0.4"
}
}
Loading

0 comments on commit 6ffa48d

Please sign in to comment.