Repository navigation
test(concerto-core): mock failed GitHub model request - #1289
Closed
junaidjmomin wants to merge 1 commit into
Closed
junaidjmomin wants to merge 1 commit into
junaidjmomin wants to merge 1 commit into
Conversation
Signed-off-by: junaidjmomin <junaidmominofficial@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Makes the ModelManager regression test for a bad github:// import deterministic by stubbing global.fetch, so the suite no longer depends on raw.githubusercontent.com returning a specific status code for a malformed URL.
Changes:
- Stub
global.fetchvia the test’s Sinon sandbox to prevent live network requests. - Mock an HTTP
404response for the invalid GitHub model URL. - Update the rejection assertion to expect the mocked
404status.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
This PR is stale because it has been open with no activity. Remove the stale label or comment to keep it active. Only items with maintainer engagement are auto-closed. |
Member
|
Thanks for your contribution. This issue has already been fixed. |
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.
Summary
global.fetchcall with the test's Sinon sandbox.Why
The test for
github://external.ctocurrently makes a live request toraw.githubusercontent.com. GitHub changed the malformed URL response from HTTP 400 to HTTP 404, causing the Core suite to fail. Updating only the expected status would leave the test dependent on external service behavior.This change keeps coverage of the default model loader path while making the test deterministic and safe to run offline.
Fixes #1286.
Related: #1287.
Validation
npm run test -w @accordproject/concerto-corepasses: 1,234 passing, 8 pending.Author checklist