Skip to content

test: mock @contentstack/cli-utilities so ESM uuid does not break the test suite#156

Open
SakshiKoli-CS wants to merge 1 commit into
developmentfrom
CL-4004
Open

test: mock @contentstack/cli-utilities so ESM uuid does not break the test suite#156
SakshiKoli-CS wants to merge 1 commit into
developmentfrom
CL-4004

Conversation

@SakshiKoli-CS
Copy link
Copy Markdown
Contributor

No description provided.

@SakshiKoli-CS SakshiKoli-CS requested review from a team as code owners May 14, 2026 14:43
@github-actions
Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Jest unit tests to avoid importing the real @contentstack/cli-utilities module (to prevent failures caused by ESM uuid resolution), by introducing a local mock module and switching several tests to use it. It also tweaks TS/ESLint configuration around test code and bumps the package version / lockfile.

Changes:

  • Added src/test/mocks/cli-utilities.ts and switched multiple Jest tests to mock @contentstack/cli-utilities via that shared mock.
  • Updated tsconfig.json to exclude src/test/** and updated ESLint config to disable max-len for *.test.ts.
  • Bumped package version to 1.9.9 and updated package-lock.json (including broad dependency version changes).

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 TypeScript project build.
src/util/logs-polling-utilities.test.ts Mocks @contentstack/cli-utilities via shared test mock.
src/test/mocks/cli-utilities.ts Adds shared Jest mock implementation for @contentstack/cli-utilities.
src/commands/launch/index.test.ts Replaces inline jest.requireActual mock with shared mock and per-test configHandler.get behavior.
src/commands/launch/functions.test.ts Mocks @contentstack/cli-utilities via shared mock.
src/adapters/github.test.ts Replaces inline @contentstack/cli-utilities mock with shared mock.
src/adapters/file-upload.test.ts Replaces inline @contentstack/cli-utilities mock with shared mock.
src/adapters/base-class.test.ts Replaces inline @contentstack/cli-utilities mock with shared mock; adjusts expected strings.
package.json Bumps package version to 1.9.9.
package-lock.json Updates lockfile (including major uuid bump and many transitive updates).
eslint.config.mjs Disables max-len for src/**/*.test.ts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/launch/index.test.ts
Comment thread src/util/logs-polling-utilities.test.ts
Comment thread src/commands/launch/functions.test.ts
Comment thread src/adapters/github.test.ts
Comment thread src/adapters/file-upload.test.ts
Comment thread src/adapters/base-class.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants