¡@

Home 

javascript Programming Glossary: spyon

How can I mock dependencies for unit testing in RequireJS?

http://stackoverflow.com/questions/11439540/how-can-i-mock-dependencies-for-unit-testing-in-requirejs

describe yourModuleName function it 'should log' function spyOn console 'log' yourModule.foo expect console.log .toHasBeenCalledWith..

How to test the done and fail Deferred Object by using jasmine

http://stackoverflow.com/questions/12080087/how-to-test-the-done-and-fail-deferred-object-by-using-jasmine

this return this beforeEach function submitFormSpy spyOn backendController 'submitForm' .andCallFake fakeFunction describe.. 'if the message is empty' function beforeEach function spyOn backendController 'submitForm' .andCallThrough replace with.. replace with wherever your callbacks are defined spyOn this 'onSuccess' spyOn this 'onFailure' this.view. el.find '#message'..

How do I verify jQuery AJAX events with Jasmine?

http://stackoverflow.com/questions/4662641/how-do-i-verify-jquery-ajax-events-with-jasmine

it should make an AJAX request to the correct URL function spyOn ajax getProduct 123 expect .ajax.mostRecentCall.args 0 url .toEqual.. should execute the callback function on success function spyOn ajax .andCallFake function options options.success var callback..

Testing backbone.js application with jasmine - how to test model bindings on a view?

http://stackoverflow.com/questions/6471457/testing-backbone-js-application-with-jasmine-how-to-test-model-bindings-on-a-v

is set up so I did the following this.myView new MyView spyOn this.myView render this.legendView.groupData.trigger change.. ... and my test then looks like this.myView new MyView spyOn this.myView render this.myView.initialize_model_bindings this.legendView.groupData.trigger.. idea w jasmine alone but believe it should be possible. spyOn this.legendView.groupData 'bind' this.myView new MyView expect..