-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
test: added coverage for fs/promises API #20219
Conversation
validateWrite() | ||
.then(validateEmptyWrite) | ||
.then(validateNonUint8ArrayWrite) | ||
.then(common.mustCall()); |
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.
It would be great to run those validations in parallel instead of waiting on the result of the former ones. Therefore it would be good to write this as:
Promise.all([
validateWrite(),
validateEmptyWrite(),
validateNonUint8ArrayWrite()
]).then(common.mustCall());
To make sure that works as expected, the temp files have to be unique though (have a unique name).
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.
@BridgeAR : Thanks for the feedback. As you said, makes sense to run those validations in parallel. I've updated the PR with the changes. Kindly review. Thanks.
This comment has been minimized.
This comment has been minimized.
Landed in 062a6e2 🎉 |
PR-URL: nodejs#20219 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
PR-URL: #20219 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Added coverage for block inside
promises#write
where thebuffer
failsisUint8Array
checkChecklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes