From 3c7a6f543e5a621209942e6c38f7882f736b63f4 Mon Sep 17 00:00:00 2001 From: tsadlerBBC Date: Wed, 14 Oct 2015 15:57:27 +0100 Subject: [PATCH] Removing hasOwnProperty check and adding jshint ignore:line where tests require inherited functions to be stubbed --- static/script-tests/tests/widgets/carousel.js | 10 ++++------ .../carousel/navigators/testhelpers/navigator.js | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/static/script-tests/tests/widgets/carousel.js b/static/script-tests/tests/widgets/carousel.js index 3d5830ca..d6a2867a 100644 --- a/static/script-tests/tests/widgets/carousel.js +++ b/static/script-tests/tests/widgets/carousel.js @@ -55,12 +55,10 @@ function stubUnstubbedFunctions(Class) { var prototype, propertyName, property; prototype = Class.prototype; - for (propertyName in prototype) { - if (prototype.hasOwnProperty(propertyName)) { - property = prototype[propertyName]; - if ((typeof property === 'function') && !(property.restore && property.restore.sinon) && propertyName !== 'self') { - self.sandbox.stub(prototype, propertyName); - } + for (propertyName in prototype) { //jshint ignore:line + property = prototype[propertyName]; + if ((typeof property === 'function') && !(property.restore && property.restore.sinon) && propertyName !== 'self') { + self.sandbox.stub(prototype, propertyName); } } } diff --git a/static/script-tests/tests/widgets/carousel/navigators/testhelpers/navigator.js b/static/script-tests/tests/widgets/carousel/navigators/testhelpers/navigator.js index e35bafac..ffc67938 100644 --- a/static/script-tests/tests/widgets/carousel/navigators/testhelpers/navigator.js +++ b/static/script-tests/tests/widgets/carousel/navigators/testhelpers/navigator.js @@ -39,12 +39,10 @@ require.def('tests/widgets/navigators/testhelpers/navigator', function stubUnstubbedFunctions(Class) { var prototype, propertyName, property; prototype = Class.prototype; - for (propertyName in prototype) { - if (prototype.hasOwnProperty(propertyName)) { - property = prototype[propertyName]; - if ((typeof property === 'function') && !(property.restore && property.restore.sinon) && propertyName !== 'self') { - self.sandbox.stub(prototype, propertyName); - } + for (propertyName in prototype) { //jshint ignore:line + property = prototype[propertyName]; + if ((typeof property === 'function') && !(property.restore && property.restore.sinon) && propertyName !== 'self') { + self.sandbox.stub(prototype, propertyName); } } }