-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a RunOnEventLoop
method to modulestest.Runtime
#3181
Conversation
RunOnEventLoop
method to modulestest.RuntimeRunOnEventLoop
method to modulestest.Runtime
Codecov Report
@@ Coverage Diff @@
## master #3181 +/- ##
==========================================
+ Coverage 72.78% 72.80% +0.01%
==========================================
Files 256 256
Lines 19697 19703 +6
==========================================
+ Hits 14337 14344 +7
+ Misses 4464 4463 -1
Partials 896 896
Flags with carried forward coverage won't be shown. Click here to find out more.
|
2b84825
to
4f152fd
Compare
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.
🚀
What?
This Pull Request adds a
RunOnEventLoop
method to themodulestest.Runtime
, to facilitate testing code that should be dispatched to the event loop, such as code that returns promises.Why?
While writing tests for the #3142, I stumbled upon this code from @mstoykov, with a
TODO
attached. I thought that as I was about to copy-paste that snippet anyway, I might as well do as instructed inTODO
and move the code to themodulestest.Runtime
class.The
TODO
hinted at potential improvements without detailing that I'd be nonetheless happy to include if necessary 🤞🏻Checklist
make ci-like-lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)