Seriously, I can not understand that document gives us:
stub.callsArg (Index) - The reason for the stub is to call the argument in the index provided in the callback function. Stub.callsArg (0); Callback is the reason for the stub to call the first argument.
However, I do not know that to be indexed in the list of these objects, I probably could not understand what a stub is ...
A stub is a nock function, program on the stub to implement a program on index
and apply it immediately.
function sayHi () {Console.log ('Hi'); } Var stub = sinon.stub (). CallsArg (2); Stub ('ABC', 42, is to say); // print "Hello"
No comments:
Post a Comment