Skip to content

Commit

Permalink
Removing hasOwnProperty check and adding jshint ignore:line where tes…
Browse files Browse the repository at this point in the history
…ts require inherited functions to be stubbed
  • Loading branch information
tsadler1988 committed Oct 14, 2015
1 parent a0708f5 commit 3c7a6f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions static/script-tests/tests/widgets/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 3c7a6f5

Please sign in to comment.