I needed to stub out a Backbone collection’s fetch method and make it return success. I’m using Jasmine BDD for the testing framework and Sinon.js for stubbing the methods. Here’s how I did it:
I needed to stub out a Backbone collection’s fetch method and make it return success. I’m using Jasmine BDD for the testing framework and Sinon.js for stubbing the methods. Here’s how I did it: