backend: cmd: Add error path test for MarshalCustomObject#6102
Conversation
Signed-off-by: CygnusMaximillian <dprajjwal11@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: CygnusMaximillian The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR adds a focused backend unit test to ensure MarshalCustomObject returns an error when given a runtime.Unknown whose Raw contains invalid JSON, covering an error path that can otherwise be missed.
Changes:
- Add
TestMarshalCustomObject_InvalidJSONto validate error surfacing for invalidruntime.Unknown.Rawdata.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CygnusMaximillian, illume The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR description
Adds an isolated test case to ensure MarshalCustomObject correctly handles and surfaces errors when provided with invalid JSON data.
Changes:
updated backend/cmd/stateless_test.go with TestMarshalCustomObject_InvalidJSON Steps to
Test:
Navigate to the backend directory.
Run npm run backend:test and verify it passes. Notes for the Reviewer: A simple, backward-compatible test that covers the previously untested error branches when handling invalid runtime.Unknown objects.
Screenshots