fix: early returns for around hooks#30
Merged
Merged
Conversation
Deploying feathers-utils with
|
| Latest commit: |
3329eb8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9915c24b.feathers-utils.pages.dev |
| Branch Preview URL: | https://fix-around-early-return.feathers-utils.pages.dev |
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.
This pull request enhances the
iff,iffElse, andcheckMultihooks to support Feathers "around" hooks by properly handling thenext()callback, and adds comprehensive test coverage for these scenarios. It also refactors and modernizes test code, removes unnecessary TypeScript error suppressions, and improves type safety and clarity throughout the test suite.The most important changes are:
Support for "around" hooks and
next()callback:iffandiffElsehooks to accept and properly handle thenextcallback, ensuring correct sequencing and compatibility with Feathers "around" hooks. This includes changes to their implementation and to the internalcallHooksutility. [1]R1, [2] [3] [4] [5]checkMultihook to support "around" hooks by callingnext()when appropriate, and added new tests to cover these cases. [1] [2] [3]Expanded and improved test coverage:
iff,iffElse, andcheckMulti, including async predicate handling and correct sequencing of inner hooks andnext(). [1] [2] [3]Test code modernization and cleanup:
@ts-expect-errorcomments and refactored tests to use async/await and proper type assertions, improving readability and reliability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]viandexpectfromvitestin test files. [1] [2] [3]Minor improvements:
.claude/settings.jsonto allowBash(npm run *)commands.