Uh oh!
There was an error while loading. Please reload this page.
Mocking @contentstack/cli-utilities to avoid ESM uuid issues and upgrade cli dependencies - #159
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
…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 |
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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