Skip to content

Commit

Permalink
if process.features.typescript is set, load jest.config.ts withou…
Browse files Browse the repository at this point in the history
…t external loader

see https://nodejs.org/api/process.html#processfeaturestypescript
This value is set if node is run with `--experimental-transform-types` or `--experimental-strip-types` so no external package is required for transpilation in those cases
  • Loading branch information
phryneas committed Jan 28, 2025
1 parent 7ea9a40 commit 248c584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jest-config/src/readConfigFileAndSetRootDir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async function readConfigFileAndSetRootDir(
let configObject;

try {
if (isTS) {
if (isTS && !process.features.typescript) {

Check failure on line 42 in packages/jest-config/src/readConfigFileAndSetRootDir.ts

View workflow job for this annotation

GitHub Actions / Typecheck Examples and Tests

Property 'typescript' does not exist on type '{ inspector: boolean; debug: boolean; uv: boolean; ipv6: boolean; tls_alpn: boolean; tls_sni: boolean; tls_ocsp: boolean; tls: boolean; }'.

Check failure on line 42 in packages/jest-config/src/readConfigFileAndSetRootDir.ts

View workflow job for this annotation

GitHub Actions / TypeScript Compatibility

Property 'typescript' does not exist on type '{ inspector: boolean; debug: boolean; uv: boolean; ipv6: boolean; tls_alpn: boolean; tls_sni: boolean; tls_ocsp: boolean; tls: boolean; }'.
configObject = await loadTSConfigFile(configPath);
} else if (isJSON) {
const fileContent = fs.readFileSync(configPath, 'utf8');
Expand Down

0 comments on commit 248c584

Please sign in to comment.