chai-spies-decorators
npm install chai-spies-decorators
Provides ES7 decorators interface for chai-spies
, allowing to set execution contracts on class methods in a nice declarative way. Requires Mocha.
How it works
I've written an article on Medium explaining it: Wiring ES7 decorators to Chai Spies for declarative contracts on class methods: A metaprogramming case study.
Warning
It is not very well tested with asynchronous tests. Should work with Promises, but not with done
callback (not implemented).