Note: Do not construct this directly, use spyOn
, spyOnProperty
, jasmine.createSpy
, or jasmine.createSpyObj
Name | Type | Description |
---|---|---|
object | object |
|
invocationOrder | number | Order of the invocation. |
args | Array | The arguments passed for this invocation. |
Accesses the default strategy for the spy. This strategy will be used whenever the spy is called with arguments that don't match any strategy created with Spy#withArgs
.
spyOn(someObj, 'func').and.returnValue(42);
Specifies a strategy to be used for calls to the spy that have the specified arguments.
Name | Type | Attributes | Description |
---|---|---|---|
args | * | <repeatable> | The arguments to match |
spyOn(someObj, 'func').withArgs(1, 2, 3).and.returnValue(42); someObj.func(1, 2, 3); // returns 42
© 2008–2017 Pivotal Labs
Licensed under the MIT License.
https://jasmine.github.io/api/3.2/Spy.html