From 54b374a18200fa172612330567873375bd60d58f Mon Sep 17 00:00:00 2001 From: ahnpnl Date: Tue, 9 Jul 2024 20:09:26 +0200 Subject: [PATCH] test(examples): replace `globals.d.ts` with `@types/jest` for projects --- examples/js-with-babel/globals.d.ts | 18 ------- examples/js-with-babel/package-lock.json | 49 +++++++++++++------ examples/js-with-babel/package.json | 4 +- examples/js-with-babel/tsconfig-esm.json | 3 +- examples/js-with-babel/tsconfig.json | 9 ++-- examples/js-with-ts/globals.d.ts | 18 ------- examples/js-with-ts/package-lock.json | 21 ++++++++ examples/js-with-ts/package.json | 1 + .../js-with-ts/src/welcome-message.spec.ts | 2 + examples/js-with-ts/tsconfig.json | 9 ++-- examples/monorepo-app/package-lock.json | 49 +++++++++++++------ examples/monorepo-app/package.json | 1 + .../tests/project-1/welcome-message.spec.ts | 2 - .../tests/project-2/welcome-message.spec.ts | 2 - examples/monorepo-app/tsconfig.base.json | 5 +- examples/react-app/tsconfig.spec.json | 5 +- examples/ts-only/globals.d.ts | 18 ------- examples/ts-only/package-lock.json | 21 ++++++++ examples/ts-only/package.json | 1 + examples/ts-only/tsconfig.json | 7 +-- examples/type-module/globals.d.ts | 18 ------- examples/type-module/package-lock.json | 21 ++++++++ examples/type-module/package.json | 1 + examples/type-module/tsconfig.json | 7 +-- 24 files changed, 169 insertions(+), 123 deletions(-) delete mode 100644 examples/js-with-babel/globals.d.ts delete mode 100644 examples/js-with-ts/globals.d.ts delete mode 100644 examples/ts-only/globals.d.ts delete mode 100644 examples/type-module/globals.d.ts diff --git a/examples/js-with-babel/globals.d.ts b/examples/js-with-babel/globals.d.ts deleted file mode 100644 index f33c1bfc34..0000000000 --- a/examples/js-with-babel/globals.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -declare global { - const beforeAll: typeof import('@jest/globals').beforeAll - const beforeEach: typeof import('@jest/globals').beforeEach - const afterAll: typeof import('@jest/globals').afterAll - const afterEach: typeof import('@jest/globals').afterEach - const describe: typeof import('@jest/globals').describe - const fdescribe: typeof import('@jest/globals').fdescribe - const xdescribe: typeof import('@jest/globals').xdescribe - const it: typeof import('@jest/globals').it - const fit: typeof import('@jest/globals').fit - const xit: typeof import('@jest/globals').xit - const test: typeof import('@jest/globals').test - const xtest: typeof import('@jest/globals').xtest - const expect: typeof import('@jest/globals').expect - const jest: typeof import('@jest/globals').jest -} - -export {} diff --git a/examples/js-with-babel/package-lock.json b/examples/js-with-babel/package-lock.json index 24cb36b3af..1efd628932 100644 --- a/examples/js-with-babel/package-lock.json +++ b/examples/js-with-babel/package-lock.json @@ -10,6 +10,7 @@ "devDependencies": { "@babel/core": "^7.24.7", "@babel/preset-env": "^7.24.7", + "@types/jest": "^29.5.12", "babel-jest": "^29.7.0", "jest": "^29.7.0", "ts-jest": "^29.2.0", @@ -2611,6 +2612,16 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "node_modules/@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", @@ -2913,12 +2924,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -3423,9 +3434,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -8370,6 +8381,16 @@ "@types/istanbul-lib-report": "*" } }, + "@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "requires": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", @@ -8608,12 +8629,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browserslist": { @@ -8972,9 +8993,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" diff --git a/examples/js-with-babel/package.json b/examples/js-with-babel/package.json index d47829877e..fc937b0c99 100644 --- a/examples/js-with-babel/package.json +++ b/examples/js-with-babel/package.json @@ -5,11 +5,13 @@ "test": "jest -c=jest.config.cjs --no-cache", "test-isolated": "jest -c=jest-isolated.config.cjs --no-cache", "test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.mjs --no-cache", - "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache" + "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache", + "tsc": "tsc --noEmit -p tsconfig-esm.json" }, "devDependencies": { "@babel/core": "^7.24.7", "@babel/preset-env": "^7.24.7", + "@types/jest": "^29.5.12", "babel-jest": "^29.7.0", "jest": "^29.7.0", "ts-jest": "^29.2.0", diff --git a/examples/js-with-babel/tsconfig-esm.json b/examples/js-with-babel/tsconfig-esm.json index a3abe66d31..d2c2d1eb24 100644 --- a/examples/js-with-babel/tsconfig-esm.json +++ b/examples/js-with-babel/tsconfig-esm.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "ESNext" + "module": "ESNext", + "esModuleInterop": true } } diff --git a/examples/js-with-babel/tsconfig.json b/examples/js-with-babel/tsconfig.json index 7b56577bc9..a299f08b63 100644 --- a/examples/js-with-babel/tsconfig.json +++ b/examples/js-with-babel/tsconfig.json @@ -1,8 +1,9 @@ { "compilerOptions": { "module": "CommonJS", - "target": "ES2015", - "allowJs": true - }, - "files": ["globals.d.ts"] + "target": "ESNext", + "allowJs": true, + "types": ["jest"], + "skipLibCheck": true + } } diff --git a/examples/js-with-ts/globals.d.ts b/examples/js-with-ts/globals.d.ts deleted file mode 100644 index f33c1bfc34..0000000000 --- a/examples/js-with-ts/globals.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -declare global { - const beforeAll: typeof import('@jest/globals').beforeAll - const beforeEach: typeof import('@jest/globals').beforeEach - const afterAll: typeof import('@jest/globals').afterAll - const afterEach: typeof import('@jest/globals').afterEach - const describe: typeof import('@jest/globals').describe - const fdescribe: typeof import('@jest/globals').fdescribe - const xdescribe: typeof import('@jest/globals').xdescribe - const it: typeof import('@jest/globals').it - const fit: typeof import('@jest/globals').fit - const xit: typeof import('@jest/globals').xit - const test: typeof import('@jest/globals').test - const xtest: typeof import('@jest/globals').xtest - const expect: typeof import('@jest/globals').expect - const jest: typeof import('@jest/globals').jest -} - -export {} diff --git a/examples/js-with-ts/package-lock.json b/examples/js-with-ts/package-lock.json index fc7a84a06a..bba556b5c5 100644 --- a/examples/js-with-ts/package-lock.json +++ b/examples/js-with-ts/package-lock.json @@ -8,6 +8,7 @@ "name": "js-with-ts", "version": "0.0.0", "devDependencies": { + "@types/jest": "^29.5.12", "jest": "^29.7.0", "ts-jest": "^29.2.0", "typescript": "~5.5.3" @@ -1068,6 +1069,16 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "node_modules/@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", @@ -4405,6 +4416,16 @@ "@types/istanbul-lib-report": "*" } }, + "@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "requires": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", diff --git a/examples/js-with-ts/package.json b/examples/js-with-ts/package.json index 1e77c54fea..b7dba51e90 100644 --- a/examples/js-with-ts/package.json +++ b/examples/js-with-ts/package.json @@ -8,6 +8,7 @@ "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache" }, "devDependencies": { + "@types/jest": "^29.5.12", "jest": "^29.7.0", "ts-jest": "^29.2.0", "typescript": "~5.5.3" diff --git a/examples/js-with-ts/src/welcome-message.spec.ts b/examples/js-with-ts/src/welcome-message.spec.ts index 0febcabd97..9c8c6a1d61 100644 --- a/examples/js-with-ts/src/welcome-message.spec.ts +++ b/examples/js-with-ts/src/welcome-message.spec.ts @@ -1,3 +1,5 @@ +import { test, expect } from '@jest/globals' + import { getWelcomeMessage } from './welcome-message' import welcomePerson from './welcome-person' diff --git a/examples/js-with-ts/tsconfig.json b/examples/js-with-ts/tsconfig.json index 7b56577bc9..8c7dda375a 100644 --- a/examples/js-with-ts/tsconfig.json +++ b/examples/js-with-ts/tsconfig.json @@ -1,8 +1,9 @@ { "compilerOptions": { "module": "CommonJS", - "target": "ES2015", - "allowJs": true - }, - "files": ["globals.d.ts"] + "target": "ESNext", + "allowJs": true, + "skipLibCheck": true, + "types": ["jest"] + } } diff --git a/examples/monorepo-app/package-lock.json b/examples/monorepo-app/package-lock.json index 2df60a8b2f..cf54e7e973 100644 --- a/examples/monorepo-app/package-lock.json +++ b/examples/monorepo-app/package-lock.json @@ -8,6 +8,7 @@ "name": "ts-only", "version": "0.0.0", "devDependencies": { + "@types/jest": "^29.5.12", "jest": "^29.7.0", "ts-jest": "^29.2.0", "typescript": "~5.5.3" @@ -1068,6 +1069,16 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "node_modules/@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", @@ -1264,12 +1275,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1687,9 +1698,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -4405,6 +4416,16 @@ "@types/istanbul-lib-report": "*" } }, + "@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "requires": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", @@ -4562,12 +4583,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browserslist": { @@ -4859,9 +4880,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" diff --git a/examples/monorepo-app/package.json b/examples/monorepo-app/package.json index c6f1fb3dd2..5ce6cf343c 100644 --- a/examples/monorepo-app/package.json +++ b/examples/monorepo-app/package.json @@ -8,6 +8,7 @@ "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache" }, "devDependencies": { + "@types/jest": "^29.5.12", "jest": "^29.7.0", "ts-jest": "^29.2.0", "typescript": "~5.5.3" diff --git a/examples/monorepo-app/tests/project-1/welcome-message.spec.ts b/examples/monorepo-app/tests/project-1/welcome-message.spec.ts index 6a13628362..4dc607fc41 100644 --- a/examples/monorepo-app/tests/project-1/welcome-message.spec.ts +++ b/examples/monorepo-app/tests/project-1/welcome-message.spec.ts @@ -1,5 +1,3 @@ -import { test, expect } from '@jest/globals' - import { getWelcomeMessage } from '../../src/welcome-message' test('should show welcome message', () => { diff --git a/examples/monorepo-app/tests/project-2/welcome-message.spec.ts b/examples/monorepo-app/tests/project-2/welcome-message.spec.ts index 6a13628362..4dc607fc41 100644 --- a/examples/monorepo-app/tests/project-2/welcome-message.spec.ts +++ b/examples/monorepo-app/tests/project-2/welcome-message.spec.ts @@ -1,5 +1,3 @@ -import { test, expect } from '@jest/globals' - import { getWelcomeMessage } from '../../src/welcome-message' test('should show welcome message', () => { diff --git a/examples/monorepo-app/tsconfig.base.json b/examples/monorepo-app/tsconfig.base.json index d763daa80f..91ef0b80cb 100644 --- a/examples/monorepo-app/tsconfig.base.json +++ b/examples/monorepo-app/tsconfig.base.json @@ -9,10 +9,11 @@ "declaration": false, "downlevelIteration": true, "experimentalDecorators": true, - "moduleResolution": "node", "importHelpers": true, + "skipLibCheck": true, "target": "ESNext", "module": "CommonJS", - "lib": ["ESNext", "dom"] + "lib": ["ESNext", "dom"], + "types": ["jest"] } } diff --git a/examples/react-app/tsconfig.spec.json b/examples/react-app/tsconfig.spec.json index cc9ea9df8d..7b9c93977b 100644 --- a/examples/react-app/tsconfig.spec.json +++ b/examples/react-app/tsconfig.spec.json @@ -2,6 +2,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "CommonJS", - "moduleResolution": "Node" + "target": "ESNext", + "moduleResolution": "Node10", + "skipLibCheck": true, + "types": ["jest"] } } diff --git a/examples/ts-only/globals.d.ts b/examples/ts-only/globals.d.ts deleted file mode 100644 index f33c1bfc34..0000000000 --- a/examples/ts-only/globals.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -declare global { - const beforeAll: typeof import('@jest/globals').beforeAll - const beforeEach: typeof import('@jest/globals').beforeEach - const afterAll: typeof import('@jest/globals').afterAll - const afterEach: typeof import('@jest/globals').afterEach - const describe: typeof import('@jest/globals').describe - const fdescribe: typeof import('@jest/globals').fdescribe - const xdescribe: typeof import('@jest/globals').xdescribe - const it: typeof import('@jest/globals').it - const fit: typeof import('@jest/globals').fit - const xit: typeof import('@jest/globals').xit - const test: typeof import('@jest/globals').test - const xtest: typeof import('@jest/globals').xtest - const expect: typeof import('@jest/globals').expect - const jest: typeof import('@jest/globals').jest -} - -export {} diff --git a/examples/ts-only/package-lock.json b/examples/ts-only/package-lock.json index 2df60a8b2f..d8b1381b6b 100644 --- a/examples/ts-only/package-lock.json +++ b/examples/ts-only/package-lock.json @@ -8,6 +8,7 @@ "name": "ts-only", "version": "0.0.0", "devDependencies": { + "@types/jest": "^29.5.12", "jest": "^29.7.0", "ts-jest": "^29.2.0", "typescript": "~5.5.3" @@ -1068,6 +1069,16 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "node_modules/@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", @@ -4405,6 +4416,16 @@ "@types/istanbul-lib-report": "*" } }, + "@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "requires": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", diff --git a/examples/ts-only/package.json b/examples/ts-only/package.json index c6f1fb3dd2..5ce6cf343c 100644 --- a/examples/ts-only/package.json +++ b/examples/ts-only/package.json @@ -8,6 +8,7 @@ "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache" }, "devDependencies": { + "@types/jest": "^29.5.12", "jest": "^29.7.0", "ts-jest": "^29.2.0", "typescript": "~5.5.3" diff --git a/examples/ts-only/tsconfig.json b/examples/ts-only/tsconfig.json index e3a6edbc6a..61ef104119 100644 --- a/examples/ts-only/tsconfig.json +++ b/examples/ts-only/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { "module": "CommonJS", - "target": "ES2021" - }, - "files": ["globals.d.ts"] + "target": "ESNext", + "skipLibCheck": true, + "types": ["jest"] + } } diff --git a/examples/type-module/globals.d.ts b/examples/type-module/globals.d.ts deleted file mode 100644 index f33c1bfc34..0000000000 --- a/examples/type-module/globals.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -declare global { - const beforeAll: typeof import('@jest/globals').beforeAll - const beforeEach: typeof import('@jest/globals').beforeEach - const afterAll: typeof import('@jest/globals').afterAll - const afterEach: typeof import('@jest/globals').afterEach - const describe: typeof import('@jest/globals').describe - const fdescribe: typeof import('@jest/globals').fdescribe - const xdescribe: typeof import('@jest/globals').xdescribe - const it: typeof import('@jest/globals').it - const fit: typeof import('@jest/globals').fit - const xit: typeof import('@jest/globals').xit - const test: typeof import('@jest/globals').test - const xtest: typeof import('@jest/globals').xtest - const expect: typeof import('@jest/globals').expect - const jest: typeof import('@jest/globals').jest -} - -export {} diff --git a/examples/type-module/package-lock.json b/examples/type-module/package-lock.json index 084b065b07..84643f5093 100644 --- a/examples/type-module/package-lock.json +++ b/examples/type-module/package-lock.json @@ -8,6 +8,7 @@ "name": "type-module", "version": "0.0.0", "devDependencies": { + "@types/jest": "^29.5.12", "jest": "^29.7.0", "ts-jest": "^29.2.0", "typescript": "~5.5.3" @@ -1068,6 +1069,16 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "node_modules/@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", @@ -4405,6 +4416,16 @@ "@types/istanbul-lib-report": "*" } }, + "@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "requires": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "@types/node": { "version": "18.7.20", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.20.tgz", diff --git a/examples/type-module/package.json b/examples/type-module/package.json index f2146e7ab1..3dfd564b4a 100644 --- a/examples/type-module/package.json +++ b/examples/type-module/package.json @@ -9,6 +9,7 @@ "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache" }, "devDependencies": { + "@types/jest": "^29.5.12", "jest": "^29.7.0", "ts-jest": "^29.2.0", "typescript": "~5.5.3" diff --git a/examples/type-module/tsconfig.json b/examples/type-module/tsconfig.json index e3a6edbc6a..61ef104119 100644 --- a/examples/type-module/tsconfig.json +++ b/examples/type-module/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { "module": "CommonJS", - "target": "ES2021" - }, - "files": ["globals.d.ts"] + "target": "ESNext", + "skipLibCheck": true, + "types": ["jest"] + } }