-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: resources should support multiple middlewares #21
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe pull request updates the Changes
Assessment against linked issues
Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it’s a critical failure. 🔧 ESLint
test/EggRouter.test.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-eggache". (The package "eslint-plugin-eggache" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-eggache" was referenced from the config file in ".eslintrc » eslint-config-egg/typescript » ./index.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses the issue where resources need to support multiple middlewares. It adds tests to verify that multiple middlewares work correctly with the resources method and updates the EggRouter API overloads and documentation to support this functionality.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
test/EggRouter.test.ts | Added tests to verify that calling router.resources() with multiple middlewares works. |
src/EggRouter.ts | Updated the method overloads and documentation to support multiple middlewares. |
Comments suppressed due to low confidence (1)
test/EggRouter.test.ts:334
- [nitpick] The test description references 'app.resource()' instead of 'app.resources()'. Consider renaming it for consistency with the actual method name.
it('should app.resource() with multiple middlewares work', () => {
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #21 +/- ##
=======================================
Coverage 99.18% 99.18%
=======================================
Files 4 4
Lines 1719 1721 +2
Branches 227 227
=======================================
+ Hits 1705 1707 +2
Misses 14 14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
[skip ci] ## [3.0.6](v3.0.5...v3.0.6) (2025-03-27) ### Bug Fixes * resources should support multiple middlewares ([#21](#21)) ([acb9c4b](acb9c4b))
closes eggjs/egg#5410
Summary by CodeRabbit