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

前端 未结 6 1600
-上瘾入骨i
-上瘾入骨i 2020-12-24 02:48

I had some interesting tribulations in trying to test whether views were correctly bound to events.  In backbone, we typically bind to events in the initialize method, using

6条回答
  •  不知归路
    2020-12-24 03:47

    You should consider looking at Sinon.js. You could stub/mock the render() call and not even have to worry about 'someOtherFunction()'.

提交回复
热议问题