Closed staltz closed 3 years ago
Wow, quite a PR. Overall from first look, this is a very nice cleanup.
I ended up reading all the tests in the new version. They are actually quite readable now. Great job cleaning this up!
@arj03 Check my latest commit, I think it should fully clarify test/block.js
Yep. This is really great. I now want to start using ssb-ebt again in browser-core after reading these tests :)
Can I green?
The new async-await control flow makes tests easier to read, since they are sequential (but still allow parallelism via
Promise.all
), a developer reading code doesn't have to jump their eyes up and down trying to follow the flow, and there's no callback pyramid.In some cases I rewrote the tests, because they either didn't assert anything, or were using inconsistent patterns (it seems like some test files used one way of connecting, while other files used another method, seems to be that one method was an old style).
A big PR, but I feel confident about these tests are now readable and deterministic (don't rely on console.logs to do "human assertion").