4 ms·
If you have slow tests that are hard to write, you're already in trouble. For example: my recent Node.js projects use Vows. More complicated test details are e
by reid 16y ago
If you have slow tests that are hard to write, you're already in trouble.
For example: my recent Node.js projects use Vows. More complicated test details are encouraged to become small functions that are reused over and over. (Vows calls these macros.) For testing HTTP servers, I wrote a set of macros, called Pact, that make my tests very concise.
For other big important pieces, I isolate myself from upstream changes by creating an interface into the dependency, then testing the interface instead.
Instead of changing lots of tests, you change a macro.
The result: very fast feedback from tests that are easy to add and change, especially when refactoring or when your plans evolve. (Using a new dependency, going sync to async, etc.)
I'd love to see these benefits in more places.
http://vowsjs.org http://vowsjs.org
https://github.com/reid/pact#readme https://github.com/reid/pact#readme