fix: run jest with --experimental-vm-modules for @oclif/core v4 dynamic imports (APPBLD-5077) - #933
Open
AnujVishwakarma-src wants to merge 1 commit into
Open
Conversation
…ic imports (APPBLD-5077) CI (and the daily master unit-test job) fails: the command-loading suites throw "A dynamic import callback was invoked without --experimental-vm-modules". @oclif/core v4 loads commands via dynamic import(); with no committed lockfile CI floats to the latest 4.x, and the unit-tests script ran plain jest without the ESM VM flag. Add cross-env (Windows-safe) and pass NODE_OPTIONS=--experimental-vm-modules, matching @adobe/aio-cli-plugin-app-templates. Validated: full suite 56 suites / 853 tests pass, 100% coverage, lint clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI on
master(and the daily "npm install and run all unit tests" job, red since ~Aug 23) fails. The command-loading suites —use,add/ci,add/event,add/service,create,delete/service— throw:Root cause
@oclif/corev4 loads commands via dynamicimport(). This repo commits no lockfile, so CI floats@oclif/coreto the latest 4.x, and theunit-testsscript ran plainjest -c jest.config.jswithout--experimental-vm-modules, so Jest can't execute the dynamic import. (Sibling repo@adobe/aio-cli-plugin-app-templatesalready runs jest with this flag and passes.)Fix
cross-envdevDependency (Windows-runner safe).unit-tests:cross-env NODE_OPTIONS=--experimental-vm-modules jest -c jest.config.js.Validation
Clean install + full suite:
🤖 Generated with Claude Code