feat: configure jest for esm dependency compatibility#430
Conversation
- 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>
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
✅ Coverage Check PassedOverall Coverage
Coverage comparison generated by |
Smoke Test Results ✅Last 2 Merged PRs:
Test Results:
Overall Status: PASS
|
|
Smoke Test Results - Claude Last 2 merged PRs:
✅ GitHub MCP: Retrieved PR data Overall Status: PASS
|
|
@copilot please merge origin/main |
…t-for-esm-support
Mossaka
left a comment
There was a problem hiding this comment.
Review: NEEDS_DISCUSSION
@copilot This PR needs clarification before it can be approved.
Issue 1: No CI Validation
No CI checks have run on this branch. The PR must pass CI to validate:
- All existing tests still pass
- The new
jest-esm-config.test.tspasses - No regressions in test coverage
Issue 2: Test Doesn't Validate ESM Transformation
The test file imports chalk v4, which has CommonJS support. The test will pass but doesn't actually prove ESM transformation works. The real validation would require testing with an actual ESM-only package (chalk v5+).
Questions
- Has this been tested locally with an ESM-only package (e.g., chalk v5)?
- Is this PR preparatory infrastructure for a future upgrade, or should it include an actual dependency upgrade?
Suggestion
Consider either:
- Adding a comment that this is preparatory infrastructure
- OR including an actual ESM-only dependency upgrade to validate the configuration works
The technical approach (babel-jest with transformIgnorePatterns) is correct and follows standard patterns.
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
…t-for-esm-support
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
Smoke Test Results (Copilot Engine)Last 2 Merged PRs:
Test Results:
Overall Status: PASS cc @Mossaka
|
Smoke Test Results - Claude EngineLast 2 Merged PRs:
✅ GitHub MCP - Retrieved PR data Overall: PASS
|
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/preset-envtargeting current Node.jsbabel-jesttransformer for JS files andtransformIgnorePatternsto transformchalk|execa|commanderin node_modules@babel/core,@babel/preset-env,babel-jestdev dependenciesScope
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.4REDACTED, pid is -1(packet block)8.8.8.8REDACTED, 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
💡 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.