redbadger / website-next

DEPRECATED incarnation of Red Badger company site
https://redbadger.github.io/website-next/
6 stars 2 forks source link

Add Chai as Promised and Sinon Chai for unit testing? #42

Open RGBboy opened 8 years ago

RGBboy commented 8 years ago

In the tests for the Workable API we started testing code that uses promises. It may be a good idea to refactor using https://github.com/domenic/chai-as-promised/ to make the tests more readable.

We also started using sinon to spy and stub certain things. We could use https://github.com/domenic/sinon-chai to get a more readable and fluent API.

RGBboy commented 8 years ago

I added sinon-as-promised in a040c347cca0557818a1b43694681435bee1565e to make mocking with promise based API's easier. This seems to be a nice way to write the tests.