Skip to content

[DevTools] Configure Jest for ESM dependency compatibility #421

@Mossaka

Description

@Mossaka

Background

PR #289 proposed adding ESM support to the Jest configuration to fix CI failures when updating ESM-only dependencies.

Problem

Dependency PRs (chalk 5.x, execa 9.x, commander 14.x, etc.) fail CI because Jest cannot parse ESM-only packages.

Proposed Changes

  • jest.config.js: Add transformIgnorePatterns to transform chalk and babel-jest for JS files
  • babel.config.js: New Babel config targeting current Node.js for ESM→CJS transformation
  • package.json: Add @babel/core, @babel/preset-env, babel-jest as dev dependencies

Expected Results

Dependency Before After
chalk 4→5 ❌ Jest ESM error ✅ Fixed
execa 5→9 ❌ API changes ❌ Needs code updates
commander 12→14 ❌ Stricter args ❌ Needs code updates

Notes

PRs for execa and commander have breaking API changes requiring source modifications—those cannot be fixed through configuration alone.


Issue created from PR #289 during backlog cleanup

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions