From afa18e554cc9652e2a7df1a80bc48d4835a4117f Mon Sep 17 00:00:00 2001 From: Gregg Van Hove Date: Tue, 14 Aug 2018 17:11:05 -0700 Subject: [PATCH] Correctly expost `spyOnAllFunctions` - See #1581 --- lib/jasmine-core/jasmine.js | 6 +++++- src/core/Env.js | 4 ++++ src/core/requireInterface.js | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index c6d27315..5b0c2bb8 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -1308,6 +1308,10 @@ getJasmineRequireObj().Env = function(j$) { return spyRegistry.spyOnProperty.apply(spyRegistry, arguments); }; + this.spyOnAllFunctions = function() { + return spyRegistry.spyOnAllFunctions.apply(spyRegistry, arguments); + }; + this.createSpy = function(name, originalFn) { if (arguments.length === 1 && j$.isFunction_(name)) { originalFn = name; @@ -5482,7 +5486,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Installs spies on all writable and configurable properties of an object. - * @name spyOnProperty + * @name spyOnAllFunctions * @function * @global * @param {Object} obj - The object upon which to install the {@link Spy}s diff --git a/src/core/Env.js b/src/core/Env.js index 3ae6be5e..f5a62a29 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -537,6 +537,10 @@ getJasmineRequireObj().Env = function(j$) { return spyRegistry.spyOnProperty.apply(spyRegistry, arguments); }; + this.spyOnAllFunctions = function() { + return spyRegistry.spyOnAllFunctions.apply(spyRegistry, arguments); + }; + this.createSpy = function(name, originalFn) { if (arguments.length === 1 && j$.isFunction_(name)) { originalFn = name; diff --git a/src/core/requireInterface.js b/src/core/requireInterface.js index ade292ab..c2d6de8e 100644 --- a/src/core/requireInterface.js +++ b/src/core/requireInterface.js @@ -237,7 +237,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Installs spies on all writable and configurable properties of an object. - * @name spyOnProperty + * @name spyOnAllFunctions * @function * @global * @param {Object} obj - The object upon which to install the {@link Spy}s