-
-
Notifications
You must be signed in to change notification settings - Fork 18
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 utility function to execute hooks serially #814
Conversation
test/hooks.js
Outdated
} | ||
const testHooks = [ | ||
() => { output += ' 1'; return Promise.resolve() }, | ||
timeoutFunc(2), |
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.
Can we use this in the above test as well
test/hooks.js
Outdated
|
||
test('serialHooks executes functions serially', t => { | ||
let output = '0' | ||
const timeoutFunc = number => { |
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.
If this helper takes in the timeout as well we can remove more code duplication below for the hooks that instantly resolve
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.
👍 9dcc68c
Codecov Report
@@ Coverage Diff @@
## master #814 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 11 12 +1
Lines 597 607 +10
=====================================
+ Hits 597 607 +10
Continue to review full report at Codecov.
|
This is great 👍 |
Summarize your changes:
Adds
serialHooks(hooks)
(ported from Electron Forge), which allows a user to run hooks serially instead of in parallel (which was added in v10.0.0 due toPromise.all
).Closes #812.