Sinon and Spies

— Spies are used to watching a single function within an object
Reference – sinonjs.org

Example

Output: