Repository navigation
test: fix the 5 failing specs and measure coverage of lib - #68
Draft
pritesh-jain-cstk wants to merge 2 commits into
Draft
pritesh-jain-cstk wants to merge 2 commits into
pritesh-jain-cstk wants to merge 2 commits into
Conversation
MKT-22142. - Extension and ContentstackUIExtension specs posted real 'init'/'ready' messages with no host to answer; stub Extension.initialize and extension.postRobot instead, and reset the extensionEvent listener between specs. - getField invalid-uid spec asserts the documented message prefix. - 'getField Invalid Uid Multiple' used a valid path and asserted nothing; it now checks the returned instance. - Instrument lib/ with babel-plugin-istanbul; npm run test:coverage reports it (97% lines). npm test no longer writes coverage/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
This was referenced Nov 4, 2026
MKT-22142. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
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.
Branch graph
Epic MKT-21682. This PR is highlighted. Only [Routine] depends on [Tests]; the rest are independent.
Merge order: #68 before #69 (#69 is based on #68). #64 and #69 both change
package.jsonandpackage-lock.json: merge #64 first, then bringmasterinto #69 with a merge (no rebase) and regenerate the lock withnpm install --legacy-peer-deps(expect a lock conflict). #65, #66, #67 and #70 are independent.What
Jira: MKT-22142
Consumer impact: none. Tests and karma config only;
lib/anddistunchanged.npm testfails onmaster(5 of 133), and the release workflow runs it before publishing. The 2.2.4 release (2026-01-16) build job failed and publish was skipped, so npm still serves 2.2.3; its logs have expired, so whether the specs or the Node 16 install failed is not known.init/readymessages to the karma page, which never answers ("No ack"); their stubs were defined but never wired. post-robot's exports are read-only getters, so the specs now stubExtension.initializeandextension.postRobot, and reset theextensionEventlistener between specs (post-robot refuses a second one for the same window).initalso asserts the SDK version is sent and that a secondinitreuses the instance.getFieldinvalid uid: asserts the prefixInvalid uid, Field not found. That prefix is not documented anywhere (the API reference does not list getField errors); it is the code's current contract (lib/entry.js:114) and the text 2.2.3 throws. b6d18c5 appended the cause to the message; that change is unreleased on npm, and extensions that compare the message for equality would see it differ on the next release.getField Invalid Uid Multipleused a valid path (group.group.group.0) insidetrywith no assertion when nothing threw; it is now "getField multiple group instance" and checks the uid and data. The returned instance has nodata_typeand itsschemais the subfield list; the docs do not define this, so it is not asserted.babel-plugin-istanbul(already a devDependency) instrumentslib/;npm run test:coveragereports 97.23% lines (was 0/0).npm testno longer writescoverage/. The 90% gate is added in the [Routine] PR, where CI runs it.Readiness items
tests.coverage,tests.coverage-script,tests.hollow-review(one hollow spec fixed)Commands (exit codes, Node 24 locally)
npm cinpm ci --legacy-peer-depsnpm run buildlint / typechecknpm testnpm audit --omit=devnpm run test:coverageCommits went through the repo's hooks (GitGuardian pre-commit and pre-push); none bypassed. Local Snyk cannot authenticate (org permission / 401), so the PR's Snyk checks are the scan.
CI:
security-licensefails here as onmaster: it requires the current year inLICENSE(still 2019-2025). Fixed by #64 (DX-29607), not by this PR. All Snyk, GitGuardian, CodeQL and policy checks pass.🤖 Generated with Claude Code