Flatten your async code. New fashion advocates promises, generators,
events, or one of the streams apis.

The classic method is to write small testable modules (see part 1) and
flatten your tree.

Turn code that looks like this [1] into this [2].

[1]
https://github.com/apache/cordova-js/blob/b75096a1bade9ca6aa0d38a2039fd922ad7c1a95/test/runner.js#L99-L136
[2]
https://github.com/apache/cordova-js/blob/ced04a4ec71f144dd2cd6c2e9392e3b1fc725ec1/tasks/lib/test-browser.js

Reply via email to