Mocking @contentstack/cli-utilities to avoid ESM uuid issues and upgrade cli dependencies#159
Merged
Conversation
… deployments with GraphQL integration Co-authored-by: Venkatesh <venkatesh.gopinath@contentstack.com> Co-authored-by: anujachordiya-contentstack <anuja.chordiya@gmail.com>
… improved error handling
… resolution logic
…r handling, and update method names for clarity
…d remove axios override
chore: upgrade @contentstack/cli-command and cli-utilities version and remove axios override
…nce error handling, and update method names for clarity" This reverts commit 3b9750a.
…ironment resolution logic" This reverts commit 189764d.
…ling and improved error handling" This reverts commit 9980454.
…previous deployments with GraphQL integration" This reverts commit ada3a18.
chore: upgrade @contentstack/cli-command and cli-utilities version and remove axios override
test: mock @contentstack/cli-utilities so ESM uuid does not break the test suite
Mocking @contentstack/cli-utilities so ESM uuid does not break the test suite
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
chhavi-mandowara-cstk
approved these changes
May 15, 2026
rohan-agrawal-cs
approved these changes
May 15, 2026
There was a problem hiding this comment.
Pull request overview
This PR aims to unblock the Jest test suite from ESM-related issues (notably via @contentstack/cli-utilities/uuid) by introducing explicit mocks for @contentstack/cli-utilities, while also upgrading CLI dependency versions and adjusting lint/build config.
Changes:
- Added a centralized Jest mock module for
@contentstack/cli-utilitiesand updated multiple Jest tests to use it. - Updated build/lint configuration (TypeScript exclude for
src/test/**, ESLint override for test file line length). - Upgraded
@contentstack/cli-command/@contentstack/cli-utilitiesand removed theaxiosoverride (lockfile updated accordingly).
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Excludes src/test/** from the TS project (build inputs). |
| eslint.config.mjs | Disables max-len for src/**/*.test.ts files. |
| src/test/mocks/cli-utilities.ts | Adds a shared Jest mock implementation for @contentstack/cli-utilities. |
| src/util/logs-polling-utilities.test.ts | Switches to the shared cli-utilities mock for Jest. |
| src/commands/launch/index.test.ts | Switches to the shared cli-utilities mock and refactors instantiation. |
| src/commands/launch/functions.test.ts | Adds cli-utilities mocking via the shared mock module. |
| src/adapters/github.test.ts | Replaces inline cli-utilities mocking with the shared mock module. |
| src/adapters/file-upload.test.ts | Replaces inline cli-utilities mocking with the shared mock module. |
| src/adapters/base-class.test.ts | Replaces inline cli-utilities mocking with the shared mock module. |
| package.json | Bumps version + upgrades CLI deps + removes axios override. |
| package-lock.json | Updates lockfile to reflect dependency upgrades/removals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Harshi-Shah-CS
approved these changes
May 15, 2026
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.
test: mock @contentstack/cli-utilities so ESM uuid does not break the test suite
chore: upgrade @contentstack/cli-command and cli-utilities version and remove axios override