I'm trying to test an EmberJS app that uses Ember.run.debounce. I'd like to use Sinon to stub Ember.run.debounce so that it will just call the debounced method synchronously. Something like this:
debounceStub = sinon.stub(Ember.run, 'debounce')
debounceStub.callsArgWith(1, debounceStub.args[0][2])
to make this code run synchronously:
Ember.run.debounce(@, @handleData, list, 500)
but handleData() is being called with an undefined argument rather than list. Any help figuring out how to pass list in the callsArgWith call would be greatly appreciated.
Thank!
Aucun commentaire:
Enregistrer un commentaire