Skip to content
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

Have promiseCallback make callbacks and promises behave the same #302

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

zwade
Copy link
Contributor

@zwade zwade commented Feb 2, 2022

This PR addresses failing tests in test/fileFactory.spec.js. These tests were failing because an fsWriteStream was emitting both an error event and a close event that caused the callback to fire twice.

However, this only happened when using a the callback interface to file.mv, as the promise interface would naturally "eat" the second event. In order to both fix the tests, and ensure that both promises and callbacks behave the same way to the user, this PR adjusts the behavior of the promiseCallback wrapper function to prevent duplicate callbacks.

@richardgirges richardgirges merged commit 3ba7d94 into richardgirges:master Feb 2, 2022
@richardgirges
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants