Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Jest cannot parse ESM-only packages, blocking dependency updates (chalk 5.x, execa 9.x, commander 14.x). This adds Babel transformation to handle ESM→CJS conversion in tests.

Changes

  • babel.config.js: New Babel config with @babel/preset-env targeting current Node.js
  • jest.config.js: Added babel-jest transformer for JS files and transformIgnorePatterns to transform chalk|execa|commander in node_modules
  • jest.integration.config.js: Applied same ESM transformation config for integration tests
  • package.json: Added @babel/core, @babel/preset-env, babel-jest dev dependencies
  • jest-esm-config.test.ts: Test suite validating ESM transformation works correctly
  • TESTING.md: Documented ESM module support

Scope

Fixes Jest's ability to parse ESM modules. Does not address API breaking changes in execa/commander upgrades - those require separate source modifications.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 8.8.4.4
    • Triggering command: REDACTED, pid is -1 (packet block)
  • 8.8.8.8
    • Triggering command: REDACTED, pid is -1 (packet block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[DevTools] Configure Jest for ESM dependency compatibility</issue_title>
<issue_description>## 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</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 27, 2026 00:03
- Add babel.config.js for ESM→CJS transformation targeting current Node.js
- Update jest.config.js with transformIgnorePatterns for chalk/execa/commander
- Add @babel/core, @babel/preset-env, babel-jest as dev dependencies
- Tests still passing (18 suites, 643 tests)

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure Jest for ESM dependency compatibility feat: configure jest for esm dependency compatibility Jan 27, 2026
Copilot AI requested a review from Mossaka January 27, 2026 00:09
@Mossaka Mossaka marked this pull request as ready for review January 27, 2026 05:53
@github-actions
Copy link

github-actions bot commented Jan 27, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link

github-actions bot commented Jan 27, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 77.98% 77.98% ➡️ +0.00%
Statements 78.05% 78.05% ➡️ +0.00%
Functions 77.77% 77.77% ➡️ +0.00%
Branches 71.70% 71.70% ➡️ +0.00%

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions
Copy link

Smoke Test Results ✅

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved PR data
  • ✅ Playwright: Page title verified ("GitHub · Change is constant. GitHub keeps you ahead. · GitHub")
  • ✅ File Write: Created /tmp/gh-aw/agent/smoke-test-copilot-21379016620.txt
  • ✅ Bash Tool: File verified successfully

Overall Status: PASS

cc: @Copilot @Mossaka

AI generated by Smoke Copilot

@github-actions
Copy link

Smoke Test Results - Claude

Last 2 merged PRs:

✅ GitHub MCP: Retrieved PR data
✅ Playwright: Navigated to github.com, title verified
✅ File Writing: Created test file
✅ Bash Tool: File contents verified

Overall Status: PASS

AI generated by Smoke Claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DevTools] Configure Jest for ESM dependency compatibility

2 participants