Is it possible to create a Spy function that returns an object that keeps track of how many times a function is called like shown below?
var spy = Spy(console, 'error')
console.error('calling console.error')
console.error('calling console.error')
console.error('calling console.error')
console.log(spy.count) // 3
console.logby yourself