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 - #156
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
There was a problem hiding this comment.
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.tsand switched multiple Jest tests to mock@contentstack/cli-utilitiesvia that shared mock. - Updated
tsconfig.jsonto excludesrc/test/**and updated ESLint config to disablemax-lenfor*.test.ts. - Bumped package version to
1.9.9and updatedpackage-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.
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.
No description provided.