test: add unit tests for TypeScript ChainAgent and BedrockFlowsAgent#540
Open
nuthalapativarun wants to merge 1 commit into
Open
test: add unit tests for TypeScript ChainAgent and BedrockFlowsAgent#540nuthalapativarun wants to merge 1 commit into
nuthalapativarun wants to merge 1 commit into
Conversation
Adds ChainAgent.test.ts (12 tests) covering constructor validation, the chaining pipeline, passthrough of additionalParams, streaming on the last agent, error propagation, and defaultOutput fallback. Adds BedrockFlowsAgent.test.ts (8 tests) covering constructor options, processRequest happy path, custom encoder/decoder, missing response stream, and client error wrapping. Closes 2FastLabs#539
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.
Issue Link (REQUIRED)
Fixes #539
Summary
Changes
Adds unit test coverage for two previously untested TypeScript agents:
ChainAgent.test.ts(12 tests)processRequest: single-agent pass-through, multi-agent pipeline (output of agent N becomes input to agent N+1),additionalParamsforwarded to every agent, default response on empty content, last-agent streaming allowed, intermediate streaming returns default response, agent error propagatesBedrockFlowsAgent.test.ts(8 tests)enableTracedefault/setprocessRequest: happy-path flow invocation + decode, missing response stream error, customflowInputEncoder, customflowOutputDecoder, client-level error wrappingBoth files follow the same mock/describe/it structure as the existing
LambdaAgent.test.ts.User experience
Before:
npx jestproduced no output forChainAgentorBedrockFlowsAgent.After: 20 new assertions covering the core behaviour and error paths of both agents.
Checklist
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.