-
Notifications
You must be signed in to change notification settings - Fork 31
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: should run restore in the current event loop #172
Conversation
WalkthroughThe recent changes involve a refactor of the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Run & review this pull request in StackBlitz Codeflow. commit: egg-mock
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- index.js (1 hunks)
- test/mock_env.test.js (2 hunks)
Additional comments not posted (4)
test/mock_env.test.js (3)
1-2
: LGTM! Explicitly importing Node.js core modules.Updating the import statements to use
node:path
andnode:assert
improves clarity.
24-39
: LGTM! New test case for asynchronous behavior.The new test case effectively verifies the asynchronous behavior of
mm.restore
within the current event loop.
43-47
: LGTM! Newsleep
function for testing asynchronous code.The
sleep
function is a useful utility for testing asynchronous code.index.js (1)
25-25
: LGTM! Improved efficiency withPromise.all
.Updating the
restore
method to executemockAgent.restore()
andmm.restore()
in parallel usingPromise.all
improves efficiency.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #172 +/- ##
==========================================
- Coverage 85.53% 85.52% -0.01%
==========================================
Files 27 27
Lines 2627 2626 -1
Branches 474 474
==========================================
- Hits 2247 2246 -1
Misses 380 380 ☔ View full report in Codecov by Sentry. |
[skip ci] ## [5.12.5](v5.12.4...v5.12.5) (2024-07-05) ### Bug Fixes * should run restore in the current event loop ([#172](#172)) ([1f9fc01](1f9fc01))
Summary by CodeRabbit
Refactor
restore
method by executing tasks in parallel.Tests
sleep
function for testing asynchronous code execution.