From 8e23c263835fb9d911f6659fe5a588fc4f5d3ffb Mon Sep 17 00:00:00 2001 From: Henry Blyth Date: Mon, 16 May 2016 10:15:36 +0100 Subject: [PATCH] Make spyOnProperty available in tests Needed adding to the env and require interface --- src/core/Env.js | 4 ++++ src/core/requireInterface.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/core/Env.js b/src/core/Env.js index ea2fa417..3152bfe5 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -293,6 +293,10 @@ getJasmineRequireObj().Env = function(j$) { return spyRegistry.spyOn.apply(spyRegistry, arguments); }; + this.spyOnProperty = function() { + return spyRegistry.spyOnProperty.apply(spyRegistry, arguments); + }; + var suiteFactory = function(description) { var suite = new j$.Suite({ env: self, diff --git a/src/core/requireInterface.js b/src/core/requireInterface.js index 840eaaed..c9632574 100644 --- a/src/core/requireInterface.js +++ b/src/core/requireInterface.js @@ -56,6 +56,10 @@ getJasmineRequireObj().interface = function(jasmine, env) { return env.spyOn(obj, methodName); }, + spyOnProperty: function(obj, methodName, accessType) { + return env.spyOnProperty(obj, methodName, accessType); + }, + jsApiReporter: new jasmine.JsApiReporter({ timer: new jasmine.Timer() }),