mardi 17 février 2015

Stubbing a get method using Sinon

I'm trying to stub the get method of an object with properties,


Works fine:


sinon.stub(input.model, 'get'); input.model.get.returns(10);


but consider if we need to stub some specific property in the object,


eg:


input.model.get('yourValue') --> how this can be stubbed? Any idea?


Aucun commentaire:

Enregistrer un commentaire