jest-config
Advanced tools
Comparing version 29.0.0-alpha.3 to 29.0.0-alpha.4
@@ -170,10 +170,8 @@ 'use strict'; | ||
return configObject; | ||
} | ||
} // Load the TypeScript configuration | ||
let registerer; // Load the TypeScript configuration | ||
const loadTSConfigFile = async configPath => { | ||
// Register TypeScript compiler instance | ||
await registerTsNode(); | ||
registerer.enabled(true); | ||
// Get registered TypeScript compiler instance | ||
const registeredCompiler = await getRegisteredCompiler(); | ||
registeredCompiler.enabled(true); | ||
let configObject = (0, _jestUtil().interopRequireDefault)( | ||
@@ -187,14 +185,19 @@ require(configPath) | ||
registerer.enabled(false); | ||
registeredCompiler.enabled(false); | ||
return configObject; | ||
}; | ||
let registeredCompilerPromise; | ||
function getRegisteredCompiler() { | ||
// Cache the promise to avoid multiple registrations | ||
registeredCompilerPromise = registeredCompilerPromise ?? registerTsNode(); | ||
return registeredCompilerPromise; | ||
} | ||
async function registerTsNode() { | ||
if (registerer) { | ||
return registerer; | ||
} | ||
try { | ||
// Register TypeScript compiler instance | ||
const tsNode = await import('ts-node'); | ||
registerer = tsNode.register({ | ||
return tsNode.register({ | ||
compilerOptions: { | ||
@@ -207,3 +210,2 @@ module: 'CommonJS' | ||
}); | ||
return registerer; | ||
} catch (e) { | ||
@@ -210,0 +212,0 @@ if (e.code === 'ERR_MODULE_NOT_FOUND') { |
@@ -229,5 +229,6 @@ 'use strict'; | ||
], | ||
watchman: true | ||
watchman: true, | ||
workerIdleMemoryLimit: (0, _jestValidate().multipleValidOptions)(0.2, '50%') | ||
}; | ||
var _default = initialOptions; | ||
exports.default = _default; |
{ | ||
"name": "jest-config", | ||
"version": "29.0.0-alpha.3", | ||
"version": "29.0.0-alpha.4", | ||
"repository": { | ||
@@ -33,5 +33,5 @@ "type": "git", | ||
"@babel/core": "^7.11.6", | ||
"@jest/test-sequencer": "^29.0.0-alpha.3", | ||
"@jest/types": "^29.0.0-alpha.3", | ||
"babel-jest": "^29.0.0-alpha.3", | ||
"@jest/test-sequencer": "^29.0.0-alpha.4", | ||
"@jest/types": "^29.0.0-alpha.4", | ||
"babel-jest": "^29.0.0-alpha.4", | ||
"chalk": "^4.0.0", | ||
@@ -42,13 +42,13 @@ "ci-info": "^3.2.0", | ||
"graceful-fs": "^4.2.9", | ||
"jest-circus": "^29.0.0-alpha.3", | ||
"jest-environment-node": "^29.0.0-alpha.3", | ||
"jest-circus": "^29.0.0-alpha.4", | ||
"jest-environment-node": "^29.0.0-alpha.4", | ||
"jest-get-type": "^29.0.0-alpha.3", | ||
"jest-regex-util": "^29.0.0-alpha.3", | ||
"jest-resolve": "^29.0.0-alpha.3", | ||
"jest-runner": "^29.0.0-alpha.3", | ||
"jest-util": "^29.0.0-alpha.3", | ||
"jest-validate": "^29.0.0-alpha.3", | ||
"jest-resolve": "^29.0.0-alpha.4", | ||
"jest-runner": "^29.0.0-alpha.4", | ||
"jest-util": "^29.0.0-alpha.4", | ||
"jest-validate": "^29.0.0-alpha.4", | ||
"micromatch": "^4.0.4", | ||
"parse-json": "^5.2.0", | ||
"pretty-format": "^29.0.0-alpha.3", | ||
"pretty-format": "^29.0.0-alpha.4", | ||
"slash": "^3.0.0", | ||
@@ -71,3 +71,3 @@ "strip-json-comments": "^3.1.1" | ||
}, | ||
"gitHead": "09981873c55442e5e494d42012f518b7d3d41fbd" | ||
"gitHead": "98a833bd4bc0bdcfcee5d4f04c2833400c4e2933" | ||
} |
108526
3304
Updated@jest/types@^29.0.0-alpha.4
Updatedbabel-jest@^29.0.0-alpha.4
Updatedjest-circus@^29.0.0-alpha.4
Updatedjest-resolve@^29.0.0-alpha.4
Updatedjest-runner@^29.0.0-alpha.4
Updatedjest-util@^29.0.0-alpha.4