Repository navigation
test: fix stale types in the cognito and api-event-handler-aws tests - #5996
Merged
Merged
Conversation
The Cognito test mocks imported from modules that no longer exist (features/shared, features/CreateAdminUser). The imports are type-only, so vitest ran fine, but yarn check:test:types failed. They now import from features/CognitoService and features/CreateUser. The S3TenantLoaderDecorator test's inner handler returned a string, while S3EventHandler returns void, and the test asserted on that string. It now checks that the inner handler ran, which it already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
/vitest |
|
Vitest tests have been initiated (for more information, click here). ✨
|
|
🚓 Slop Cop ✅ Nothing worth flagging. The diff looks consistent with the PR's stated intent and the code-style rules. Small, focused test-only diff matching the stated intent, with no style violations in the changed lines. Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 3
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What
yarn check:test:typesfailed for@webiny/cognitoand@webiny/api-event-handler-awson three test files. Vitest doesn't type-check, so the tests themselves passed.packages/cognito/__tests__/mocks/MockCognitoService.tsandmocks/users.tsimported fromfeatures/sharedandfeatures/CreateAdminUser, which no longer exist. The imports are type-only, which is why nothing failed at runtime. They now importCognitoServicefromfeatures/CognitoServiceandCreateAdminUserInputfromfeatures/CreateUser.packages/api-event-handler-aws/__tests__/S3TenantLoaderDecorator.test.tsstubbed the innerS3EventHandlerwith one returning"inner-ok", but the handler returnsvoid, and the test asserted on that string. The stub now returns nothing; the test still checks that the inner handler ran.Test-only. No source changes.
Checks
yarn check:test:types -p cognito,api-event-handler-aws: 0 errors (was 3).cognito(14),api-event-handler-aws(6).Workspace: wby-next11 · STORAGE PER REQ
🤖 Generated with Claude Code
Summary by CodeRabbit