Improving sinon.js spy example