From bd59ba590adfe60d624e9927860117faaee6c0c9 Mon Sep 17 00:00:00 2001 From: Anuj Vishwakarma <298213938+AnujVishwakarma-src@users.noreply.github.com> Date: Tue, 8 Sep 2026 18:28:44 +0530 Subject: [PATCH] fix: run jest with --experimental-vm-modules for @oclif/core v4 dynamic 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) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 899db08c..55e06ff2 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "@types/jest": "^29", "babel-runtime": "^6.26.0", "core-js": "^3", + "cross-env": "^7.0.3", "eol": "^0.9.1", "eslint": "^9", "eslint-plugin-jsdoc": "^48.11.0", @@ -92,7 +93,7 @@ "lint-fix": "npm run lint -- --fix", "prepack": "oclif manifest && oclif readme --no-aliases", "test": "npm run unit-tests && npm run lint", - "unit-tests": "jest -c jest.config.js", + "unit-tests": "cross-env NODE_OPTIONS=--experimental-vm-modules jest -c jest.config.js", "version": "oclif readme --no-aliases && git add README.md", "update-openwhisk-runtimes": "node bin/openwhisk-standalone-config/get-runtimes.js > bin/openwhisk-standalone-config/runtimes.json" },