@@ -336,10 +336,9 @@ def _create_codeflash_jest_config(
336336def _get_jest_config_for_project (project_root : Path ) -> Path | None :
337337 """Get the appropriate Jest config for the project.
338338
339- Creates a codeflash-compatible Jest config that handles:
340- - ESM packages in node_modules that need transformation
341- - TypeScript files with proper ts-jest configuration
342- - bundler moduleResolution compatibility
339+ If the project uses bundler moduleResolution, creates and returns a
340+ codeflash-compatible Jest config. Otherwise, returns the project's
341+ existing Jest config.
343342
344343 Args:
345344 project_root: Root of the project.
@@ -356,12 +355,10 @@ def _get_jest_config_for_project(project_root: Path) -> Path | None:
356355 logger .info ("Detected bundler moduleResolution - creating compatible config" )
357356 # Create codeflash-compatible tsconfig
358357 _create_codeflash_tsconfig (project_root )
359-
360- # Always create a codeflash Jest config to handle ESM packages properly
361- # Many modern NPM packages are ESM-only and need transformation
362- codeflash_jest_config = _create_codeflash_jest_config (project_root , original_jest_config , for_esm = True )
363- if codeflash_jest_config :
364- return codeflash_jest_config
358+ # Create codeflash Jest config that uses it
359+ codeflash_jest_config = _create_codeflash_jest_config (project_root , original_jest_config )
360+ if codeflash_jest_config :
361+ return codeflash_jest_config
365362
366363 return original_jest_config
367364
0 commit comments