coinbase / coinbase-pro-trading-toolkit

DEPRECATED — The Coinbase Pro trading toolkit
Apache License 2.0
870 stars 239 forks source link

GDAXExchangeTest: return promise instead of using done. #229

Closed blair closed 6 years ago

blair commented 6 years ago

If an assertion inside a .then() block fails then mocha will timeout instead of printing the actual error. So return the Promise instead so mocha can print the actual error.

Example generated error when an assertion failes:

1) GDAX Exchange API returns candles: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. at Timeout. (node_modules/mocha/lib/runnable.js:232:19) at ontimeout (timers.js:466:11) at tryOnTimeout (timers.js:304:5) at Timer.listOnTimeout (timers.js:267:5)