Update dependencies#496
Merged
Merged
Conversation
@smithy/core v3.x introduced sub-path exports (/schema, /protocols, etc.)
with circular dependencies that break Jest 27's module system. When aws.js
is loaded (directly or via app.js), it initializes all 5 AWS SDK clients at
module level; any unmocked client triggers the cycle, leaving schema undefined
and crashing with "Cannot read properties of undefined (reading 'for')".
Fixes:
- Add __tests__/__mocks__/aws.js with jest.fn() stubs for all aws.js exports
- Endpoint tests: switch jest.mock("aws.js") to use factory pointing at the
manual mock, preventing the real aws.js from loading
- AWS unit tests: add stub mocks for each AWS SDK client not under test so
none of the real constructors run during module initialization
- app.test.js, error.test.js: mock aws.js since they load it via app.js
- package.json: add testPathIgnorePatterns to exclude __mocks__/ from test
discovery
Generated with Claude Sonnet 4.6 (claude-sonnet-4-6) via Claude Code
Framework: Jest 27 (babel-jest)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated with Claude Sonnet 4.6 (claude-sonnet-4-6) via Claude Code Framework: Jest 27 (babel-jest), ESLint 7
lwrubel
approved these changes
May 18, 2026
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.
No description provided.