Moved createSpy to env so it can be stateful

This commit is contained in:
Steve Gravrock
2018-01-09 10:16:02 -08:00
parent 298b5ba127
commit 6f119c4e5a
12 changed files with 147 additions and 97 deletions

View File

@@ -256,6 +256,18 @@ getJasmineRequireObj().interface = function(jasmine, env) {
return env.clock;
};
/**
* Create a bare {@link Spy} object. This won't be installed anywhere and will not have any implementation behind it.
* @name jasmine.createSpy
* @function
* @param {String} [name] - Name to give the spy. This will be displayed in failure messages.
* @param {Function} [originalFn] - Function to act as the real implementation.
* @return {Spy}
*/
jasmine.createSpy = function(name, originalFn) {
return env.createSpy(name, originalFn);
};
/**
* Create an object with multiple {@link Spy}s as its members.
* @name jasmine.createSpyObj