You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
Currently, we duplicate all the tests (yay) so we're testing both the promise and callback implementations. While the idea is good, the implementation (copy-paste) is not ideal.
Proposed implementation is to have one function with a callback that will automatically tests both implementations and remove all the duplicated tests.
Another solution is to only test the callback vs promise interface in dedicated tests, and chose either callbacks or promises for the tests of the tests. But, we might miss some places by doing this.
The text was updated successfully, but these errors were encountered:
We currently use Callbacks for all of the serious testing and then have a Promise test per function to check the promisify is there. I believe this is your proposed solution 2)
As for proposed solution 1), it does sound good. Wanna do a PR with that solution to see how it looks?
then have a Promise test per function [...] I believe this is your proposed solution
Proposal 2 would be more aggressive and just test callback/promise in one place, instead of per function. To ensure that the general idea is working. But, as mentioned, there is a risk of missing implementations that way.
The more I think about it, the less sense it makes to test callback/promise implementations all over the place. It would make more sense to abstract out the logic for taking care of the arguments in a separate tests and then the rest would be covered by promisify-es6 itself.
Only worry is where we are doing bunch of shuffling around of the arguments, which as mentioned should be abstracted away into it's own functions instead of being ad-hoc, but needs to be carefully done.
Currently, we duplicate all the tests (yay) so we're testing both the promise and callback implementations. While the idea is good, the implementation (copy-paste) is not ideal.
Proposed implementation is to have one function with a callback that will automatically tests both implementations and remove all the duplicated tests.
Another solution is to only test the callback vs promise interface in dedicated tests, and chose either callbacks or promises for the tests of the tests. But, we might miss some places by doing this.
The text was updated successfully, but these errors were encountered: