Can you restore a method based on withArgs

138 views
Skip to first unread message

Kurt Snyder

unread,
Sep 25, 2014, 1:05:28 PM9/25/14
to sin...@googlegroups.com
We have a method with a number of stubs set up based on arguments (withArgs).  If we want to change one of these stubs for a particular argument signature only, is it possible?  I thought perhaps there was a way with restore:  
object.method.withArgs.restore()

but this returns an error.

Thx.

Maximilian Antoni

unread,
Sep 25, 2014, 2:33:24 PM9/25/14
to sin...@googlegroups.com
I guess this works:

    var s = sinon.stub(...).withArgs(...);
    s.reset();

Cheers
-Max
--
You received this message because you are subscribed to the Google Groups "Sinon.JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinonjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages