diff --git a/package.json b/package.json index be154d9..5329e8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-sinon", - "version": "2.0.0", + "version": "2.0.1", "description": "sinon library extension to stub whole object and interfaces", "author": { "name": "Tomasz Tarnowski", diff --git a/src/index.ts b/src/index.ts index 7afc256..f8fa312 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ export function stubObject(object: T, methods?: ObjectMethodsK ]; for (let method in object) { - if (object.hasOwnProperty(method) && typeof object[method] == "function") { + if (typeof object[method] == "function") { objectMethods.push(method); } } @@ -40,10 +40,8 @@ export function stubObject(object: T, methods?: ObjectMethodsK } } else if (typeof methods == "object") { for (let method in methods) { - if (methods.hasOwnProperty(method)) { - stubObject[method] = sinon.stub(); - stubObject[method].returns(methods[method]); - } + stubObject[method] = sinon.stub(); + stubObject[method].returns(methods[method]); } } else { for (let method of objectMethods) {