diff --git a/examples/js-with-babel/jest-esm-isolated.config.js b/examples/js-with-babel/jest-esm-isolated.config.mjs similarity index 67% rename from examples/js-with-babel/jest-esm-isolated.config.js rename to examples/js-with-babel/jest-esm-isolated.config.mjs index 21f87ed93d..41132b8678 100644 --- a/examples/js-with-babel/jest-esm-isolated.config.js +++ b/examples/js-with-babel/jest-esm-isolated.config.mjs @@ -1,8 +1,10 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { - preset: 'ts-jest/presets/js-with-babel-esm', +export default { + ...preset.jsWithBabelESM, transform: { - '^.+\\.tsx?$': [ + '^.+\.[tj]sx?$': [ 'ts-jest', { babelConfig: true, diff --git a/examples/js-with-babel/jest-esm.config.js b/examples/js-with-babel/jest-esm.config.mjs similarity index 64% rename from examples/js-with-babel/jest-esm.config.js rename to examples/js-with-babel/jest-esm.config.mjs index 03cfa1ca30..3cb4b4fb7a 100644 --- a/examples/js-with-babel/jest-esm.config.js +++ b/examples/js-with-babel/jest-esm.config.mjs @@ -1,8 +1,10 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { - preset: 'ts-jest/presets/js-with-babel-esm', +export default { + ...preset.jsWithBabelESM, transform: { - '^.+\\.tsx?$': [ + '^.+\.[tj]sx?$': [ 'ts-jest', { babelConfig: true, diff --git a/examples/js-with-babel/jest-isolated.config.js b/examples/js-with-babel/jest-isolated.config.cjs similarity index 68% rename from examples/js-with-babel/jest-isolated.config.js rename to examples/js-with-babel/jest-isolated.config.cjs index e6c14d7ce7..90d06322ec 100644 --- a/examples/js-with-babel/jest-isolated.config.js +++ b/examples/js-with-babel/jest-isolated.config.cjs @@ -1,8 +1,10 @@ +const preset = require('ts-jest/presets') + /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { - preset: 'ts-jest/presets/js-with-babel', + ...preset.jsWithBabel, transform: { - '^.+\\.tsx?$': [ + '^.+\.[tj]sx?$': [ 'ts-jest', { babelConfig: true, diff --git a/examples/js-with-babel/jest.config.js b/examples/js-with-babel/jest.config.cjs similarity index 71% rename from examples/js-with-babel/jest.config.js rename to examples/js-with-babel/jest.config.cjs index 83b3802871..d2f89337ec 100644 --- a/examples/js-with-babel/jest.config.js +++ b/examples/js-with-babel/jest.config.cjs @@ -1,8 +1,7 @@ /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { - preset: 'ts-jest/presets/js-with-babel', transform: { - '^.+\\.tsx?$': [ + '^.+\.[tj]sx?$': [ 'ts-jest', { babelConfig: true, diff --git a/examples/js-with-babel/package-lock.json b/examples/js-with-babel/package-lock.json index 09f9af345a..52db4f8afb 100644 --- a/examples/js-with-babel/package-lock.json +++ b/examples/js-with-babel/package-lock.json @@ -13,7 +13,7 @@ "babel-jest": "^29.5.0", "jest": "^29.5.0", "ts-jest": "^29.1.0", - "typescript": "~4.9.5" + "typescript": "~5.0.3" } }, "node_modules/@ampproject/remapping": { @@ -6056,16 +6056,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/unicode-canonical-property-names-ecmascript": { @@ -10739,9 +10739,9 @@ "dev": true }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true }, "unicode-canonical-property-names-ecmascript": { diff --git a/examples/js-with-babel/package.json b/examples/js-with-babel/package.json index 53f10abcb4..7e64f21ef5 100644 --- a/examples/js-with-babel/package.json +++ b/examples/js-with-babel/package.json @@ -2,10 +2,10 @@ "name": "js-with-babel", "version": "0.0.0", "scripts": { - "test": "jest --no-cache", - "test-isolated": "jest -c=jest-isolated.config.js --no-cache", - "test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.js --no-cache", - "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache" + "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" }, "devDependencies": { "@babel/core": "^7.21.4", @@ -13,6 +13,6 @@ "babel-jest": "^29.5.0", "jest": "^29.5.0", "ts-jest": "^29.1.0", - "typescript": "~4.9.5" + "typescript": "~5.0.3" } } diff --git a/examples/js-with-ts/jest-esm-isolated.config.js b/examples/js-with-ts/jest-esm-isolated.config.mjs similarity index 65% rename from examples/js-with-ts/jest-esm-isolated.config.js rename to examples/js-with-ts/jest-esm-isolated.config.mjs index 08be5b806e..6fa28a1e31 100644 --- a/examples/js-with-ts/jest-esm-isolated.config.js +++ b/examples/js-with-ts/jest-esm-isolated.config.mjs @@ -1,8 +1,10 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { - preset: 'ts-jest/presets/js-with-ts-esm', +export default { + ...preset.jsWithTsESM, transform: { - '^.+\\.m?[tj]sx?$': [ + '^.+\.[tj]sx?$': [ 'ts-jest', { isolatedModules: true, diff --git a/examples/js-with-ts/jest-esm.config.js b/examples/js-with-ts/jest-esm.config.mjs similarity index 61% rename from examples/js-with-ts/jest-esm.config.js rename to examples/js-with-ts/jest-esm.config.mjs index c018ddcc62..13023d4854 100644 --- a/examples/js-with-ts/jest-esm.config.js +++ b/examples/js-with-ts/jest-esm.config.mjs @@ -1,8 +1,10 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { - preset: 'ts-jest/presets/js-with-ts-esm', +export default { + ...preset.jsWithTsESM, transform: { - '^.+\\.m?[tj]sx?$': [ + '^.+\.[tj]sx?$': [ 'ts-jest', { tsconfig: 'tsconfig-esm.json', diff --git a/examples/js-with-ts/jest-isolated.config.js b/examples/js-with-ts/jest-isolated.config.cjs similarity index 65% rename from examples/js-with-ts/jest-isolated.config.js rename to examples/js-with-ts/jest-isolated.config.cjs index f55c5555b8..3e72dca833 100644 --- a/examples/js-with-ts/jest-isolated.config.js +++ b/examples/js-with-ts/jest-isolated.config.cjs @@ -1,8 +1,10 @@ +const preset = require('ts-jest/presets') + /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { - preset: 'ts-jest/presets/js-with-ts', + ...preset.jsWithTs, transform: { - '^.+\\.[tj]sx?$': [ + '^.+\.[tj]sx?$': [ 'ts-jest', { isolatedModules: true, diff --git a/examples/js-with-ts/jest.config.js b/examples/js-with-ts/jest.config.cjs similarity index 53% rename from examples/js-with-ts/jest.config.js rename to examples/js-with-ts/jest.config.cjs index 92763175ee..935cce761f 100644 --- a/examples/js-with-ts/jest.config.js +++ b/examples/js-with-ts/jest.config.cjs @@ -1,4 +1,6 @@ +const preset = require('ts-jest/presets') + /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { - preset: 'ts-jest/presets/js-with-ts', + ...preset.jsWithTs, } diff --git a/examples/js-with-ts/package-lock.json b/examples/js-with-ts/package-lock.json index 93ab72cb9f..03ae086ab4 100644 --- a/examples/js-with-ts/package-lock.json +++ b/examples/js-with-ts/package-lock.json @@ -10,7 +10,7 @@ "devDependencies": { "jest": "^29.5.0", "ts-jest": "^29.1.0", - "typescript": "~4.9.5" + "typescript": "~5.0.3" } }, "node_modules/@ampproject/remapping": { @@ -3350,16 +3350,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/update-browserslist-db": { @@ -6040,9 +6040,9 @@ "dev": true }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true }, "update-browserslist-db": { diff --git a/examples/js-with-ts/package.json b/examples/js-with-ts/package.json index d95b6f15fa..7453a9be35 100644 --- a/examples/js-with-ts/package.json +++ b/examples/js-with-ts/package.json @@ -2,14 +2,14 @@ "name": "js-with-ts", "version": "0.0.0", "scripts": { - "test": "jest --no-cache", - "test-isolated": "jest -c=jest-isolated.config.js --no-cache", - "test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.js --no-cache", - "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache" + "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" }, "devDependencies": { "jest": "^29.5.0", "ts-jest": "^29.1.0", - "typescript": "~4.9.5" + "typescript": "~5.0.3" } } diff --git a/examples/react-app/jest-esm-isolated.config.js b/examples/react-app/jest-esm-isolated.config.mjs similarity index 70% rename from examples/react-app/jest-esm-isolated.config.js rename to examples/react-app/jest-esm-isolated.config.mjs index ca3724ea17..374186b762 100644 --- a/examples/react-app/jest-esm-isolated.config.js +++ b/examples/react-app/jest-esm-isolated.config.mjs @@ -1,11 +1,10 @@ -const baseEsmCfg = require('./jest-esm.config') -const baseCfg = require('./jest.config') +import baseEsmCfg from './jest-esm.config.mjs' /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { +export default { ...baseEsmCfg, transform: { - ...baseCfg.transform, + ...baseEsmCfg.transform, '^.+\\.(ts|tsx)$': [ 'ts-jest', { diff --git a/examples/react-app/jest-esm.config.js b/examples/react-app/jest-esm.config.mjs similarity index 85% rename from examples/react-app/jest-esm.config.js rename to examples/react-app/jest-esm.config.mjs index 9c941b67d1..888c5c4356 100644 --- a/examples/react-app/jest-esm.config.js +++ b/examples/react-app/jest-esm.config.mjs @@ -1,7 +1,7 @@ -const baseCfg = require('./jest.config') +import baseCfg from './jest.config.cjs' /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { +export default { ...baseCfg, preset: 'ts-jest/presets/js-with-babel-esm', transform: { diff --git a/examples/react-app/jest-isolated.config.js b/examples/react-app/jest-isolated.config.cjs similarity index 86% rename from examples/react-app/jest-isolated.config.js rename to examples/react-app/jest-isolated.config.cjs index 2c3e3f9f88..6110c6a6fa 100644 --- a/examples/react-app/jest-isolated.config.js +++ b/examples/react-app/jest-isolated.config.cjs @@ -1,4 +1,4 @@ -const baseCfg = require('./jest.config') +const baseCfg = require('./jest.config.cjs') /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { diff --git a/examples/react-app/jest.config.js b/examples/react-app/jest.config.cjs similarity index 100% rename from examples/react-app/jest.config.js rename to examples/react-app/jest.config.cjs diff --git a/examples/react-app/package-lock.json b/examples/react-app/package-lock.json index 0570552f5e..06befbe938 100644 --- a/examples/react-app/package-lock.json +++ b/examples/react-app/package-lock.json @@ -59,8 +59,8 @@ "style-loader": "^3.3.1", "tailwindcss": "^3.0.2", "terser-webpack-plugin": "^5.2.5", - "ts-jest": "^29.0.2", - "typescript": "^4.5.5", + "ts-jest": "^29.1.0", + "typescript": "~5.0.3", "web-vitals": "^2.1.4", "webpack": "^5.76.0", "webpack-dev-server": "^4.6.0", @@ -15076,14 +15076,14 @@ "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==" }, "node_modules/ts-jest": { - "version": "29.0.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.2.tgz", - "integrity": "sha512-P03IUItnAjG6RkJXtjjD5pu0TryQFOwcb1YKmW63rO19V0UFqL3wiXZrmR5D7qYjI98btzIOAcYafLZ0GHAcQg==", + "version": "29.1.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz", + "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==", "dependencies": { "bs-logger": "0.x", "fast-json-stable-stringify": "2.x", "jest-util": "^29.0.0", - "json5": "^2.2.1", + "json5": "^2.2.3", "lodash.memoize": "4.x", "make-error": "1.x", "semver": "7.x", @@ -15100,7 +15100,7 @@ "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", - "typescript": ">=4.3" + "typescript": ">=4.3 <6" }, "peerDependenciesMeta": { "@babel/core": { @@ -15214,15 +15214,15 @@ } }, "node_modules/typescript": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", - "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/unbox-primitive": { @@ -26890,14 +26890,14 @@ "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==" }, "ts-jest": { - "version": "29.0.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.2.tgz", - "integrity": "sha512-P03IUItnAjG6RkJXtjjD5pu0TryQFOwcb1YKmW63rO19V0UFqL3wiXZrmR5D7qYjI98btzIOAcYafLZ0GHAcQg==", + "version": "29.1.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz", + "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==", "requires": { "bs-logger": "0.x", "fast-json-stable-stringify": "2.x", "jest-util": "^29.0.0", - "json5": "^2.2.1", + "json5": "^2.2.3", "lodash.memoize": "4.x", "make-error": "1.x", "semver": "7.x", @@ -26978,9 +26978,9 @@ } }, "typescript": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", - "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==" + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==" }, "unbox-primitive": { "version": "1.0.2", diff --git a/examples/react-app/package.json b/examples/react-app/package.json index b98dd16b01..c24e3a1d73 100644 --- a/examples/react-app/package.json +++ b/examples/react-app/package.json @@ -54,8 +54,8 @@ "style-loader": "^3.3.1", "tailwindcss": "^3.0.2", "terser-webpack-plugin": "^5.2.5", - "ts-jest": "^29.0.2", - "typescript": "^4.5.5", + "ts-jest": "^29.1.0", + "typescript": "~5.0.3", "web-vitals": "^2.1.4", "webpack": "^5.76.0", "webpack-dev-server": "^4.6.0", @@ -65,10 +65,10 @@ "scripts": { "start": "node scripts/start.js", "build": "node scripts/build.js", - "test": "jest --no-cache", - "test-isolated": "jest -c=jest-isolated.config.js --no-cache", - "test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.js --no-cache", - "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache" + "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" }, "browserslist": { "production": [ diff --git a/examples/ts-only/jest-esm-isolated.config.js b/examples/ts-only/jest-esm-isolated.config.mjs similarity index 72% rename from examples/ts-only/jest-esm-isolated.config.js rename to examples/ts-only/jest-esm-isolated.config.mjs index 0f6afa535c..60854a38d4 100644 --- a/examples/ts-only/jest-esm-isolated.config.js +++ b/examples/ts-only/jest-esm-isolated.config.mjs @@ -1,6 +1,8 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { - preset: 'ts-jest/presets/default-esm', +export default { + ...preset.defaultsESM, transform: { '^.+\\.tsx?$': [ 'ts-jest', diff --git a/examples/ts-only/jest-esm.config.js b/examples/ts-only/jest-esm.config.mjs similarity index 69% rename from examples/ts-only/jest-esm.config.js rename to examples/ts-only/jest-esm.config.mjs index 5ee348a6cf..89583e7c65 100644 --- a/examples/ts-only/jest-esm.config.js +++ b/examples/ts-only/jest-esm.config.mjs @@ -1,6 +1,8 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ -module.exports = { - preset: 'ts-jest/presets/default-esm', +export default { + ...preset.defaultsESM, transform: { '^.+\\.tsx?$': [ 'ts-jest', diff --git a/examples/ts-only/jest-isolated.config.js b/examples/ts-only/jest-isolated.config.cjs similarity index 74% rename from examples/ts-only/jest-isolated.config.js rename to examples/ts-only/jest-isolated.config.cjs index 7e0e8d47e6..08ba2ebaca 100644 --- a/examples/ts-only/jest-isolated.config.js +++ b/examples/ts-only/jest-isolated.config.cjs @@ -1,6 +1,8 @@ +const preset = require('ts-jest/presets'); + /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { - preset: 'ts-jest', + ...preset.defaults, transform: { '^.+\\.tsx?$': [ 'ts-jest', diff --git a/examples/ts-only/jest.config.js b/examples/ts-only/jest.config.cjs similarity index 53% rename from examples/ts-only/jest.config.js rename to examples/ts-only/jest.config.cjs index e83af2939d..c09314495e 100644 --- a/examples/ts-only/jest.config.js +++ b/examples/ts-only/jest.config.cjs @@ -1,4 +1,6 @@ +const preset = require('ts-jest/presets'); + /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { - preset: 'ts-jest', + ...preset.defaults, } diff --git a/examples/ts-only/package-lock.json b/examples/ts-only/package-lock.json index ae5317215d..276decc9a0 100644 --- a/examples/ts-only/package-lock.json +++ b/examples/ts-only/package-lock.json @@ -10,7 +10,7 @@ "devDependencies": { "jest": "^29.5.0", "ts-jest": "^29.1.0", - "typescript": "~4.9.5" + "typescript": "~5.0.3" } }, "node_modules/@ampproject/remapping": { @@ -3350,16 +3350,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/update-browserslist-db": { @@ -6040,9 +6040,9 @@ "dev": true }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true }, "update-browserslist-db": { diff --git a/examples/ts-only/package.json b/examples/ts-only/package.json index ab751c289a..e2489e9ea4 100644 --- a/examples/ts-only/package.json +++ b/examples/ts-only/package.json @@ -2,14 +2,14 @@ "name": "ts-only", "version": "0.0.0", "scripts": { - "test": "jest --no-cache", - "test-isolated": "jest -c=jest-isolated.config.js --no-cache", - "test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.js --no-cache", - "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache" + "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" }, "devDependencies": { "jest": "^29.5.0", "ts-jest": "^29.1.0", - "typescript": "~4.9.5" + "typescript": "~5.0.3" } } diff --git a/examples/type-module/jest-esm-isolated.config.js b/examples/type-module/jest-esm-isolated.config.js index 3330fc94f0..d0b7f1b9cd 100644 --- a/examples/type-module/jest-esm-isolated.config.js +++ b/examples/type-module/jest-esm-isolated.config.js @@ -1,6 +1,8 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ const jestConfig = { - preset: 'ts-jest/presets/default-esm', + ...preset.defaultsESM, transform: { '^.+\\.tsx?$': [ 'ts-jest', diff --git a/examples/type-module/jest-esm.config.js b/examples/type-module/jest-esm.config.js index 68888b8975..787d1afbfc 100644 --- a/examples/type-module/jest-esm.config.js +++ b/examples/type-module/jest-esm.config.js @@ -1,6 +1,8 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ const jestConfig = { - preset: 'ts-jest/presets/default-esm', + ...preset.defaultsESM, transform: { '^.+\\.tsx?$': [ 'ts-jest', diff --git a/examples/type-module/jest-isolated.config.js b/examples/type-module/jest-isolated.config.js index 3a0dfa643c..6986444b56 100644 --- a/examples/type-module/jest-isolated.config.js +++ b/examples/type-module/jest-isolated.config.js @@ -1,6 +1,8 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ const jestConfig = { - preset: 'ts-jest', + ...preset.defaults, transform: { '^.+\\.tsx?$': [ 'ts-jest', diff --git a/examples/type-module/jest.config.js b/examples/type-module/jest.config.js index 1cd092f8ff..58a7b7ec78 100644 --- a/examples/type-module/jest.config.js +++ b/examples/type-module/jest.config.js @@ -1,6 +1,8 @@ +import preset from 'ts-jest/presets/index.js' + /** @type {import('ts-jest').JestConfigWithTsJest} */ const jestConfig = { - preset: 'ts-jest', + ...preset.defaults, } export default jestConfig diff --git a/examples/type-module/package-lock.json b/examples/type-module/package-lock.json index 38b74e733b..a714c0d9cd 100644 --- a/examples/type-module/package-lock.json +++ b/examples/type-module/package-lock.json @@ -10,7 +10,7 @@ "devDependencies": { "jest": "^29.5.0", "ts-jest": "^29.1.0", - "typescript": "~4.9.5" + "typescript": "~5.0.3" } }, "node_modules/@ampproject/remapping": { @@ -3350,16 +3350,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/update-browserslist-db": { @@ -6040,9 +6040,9 @@ "dev": true }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", + "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true }, "update-browserslist-db": { diff --git a/examples/type-module/package.json b/examples/type-module/package.json index 2acda4a0fa..46798ca35d 100644 --- a/examples/type-module/package.json +++ b/examples/type-module/package.json @@ -3,7 +3,7 @@ "type": "module", "version": "0.0.0", "scripts": { - "test": "jest --no-cache", + "test": "jest -c=jest.config.js --no-cache", "test-isolated": "jest -c=jest-isolated.config.js --no-cache", "test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.js --no-cache", "test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.js --no-cache" @@ -11,6 +11,6 @@ "devDependencies": { "jest": "^29.5.0", "ts-jest": "^29.1.0", - "typescript": "~4.9.5" + "typescript": "~5.0.3" } }