From b56aae06665f7cb278b3d42da4668afbac0bbdf8 Mon Sep 17 00:00:00 2001 From: Craig Bilner Date: Thu, 28 Jan 2016 21:03:36 +0000 Subject: [PATCH] Protect methods and reset before test --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index cd5fd40..fd5867e 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,8 @@ const doNotSpyOn = { constructor: false, componentWillUnmount: false, render: false, + getChildContext: false, + getNextStampType: false, }; // FLAVOUR COMPONENT @@ -26,6 +28,8 @@ const propFunc = function (propToTest) { const mapsTo = function (method) { const symbolToTest = Symbol(method); + + this.reactClass.prototype[method].reset(); this.props[this.propToTest](symbolToTest); return this.reactClass.prototype[method].lastCall.args.indexOf(symbolToTest) > -1;