From 6fa1e9acd891263954fd1bce71c1770f7669c2c7 Mon Sep 17 00:00:00 2001 From: Toru Kobayashi Date: Wed, 4 Jul 2018 16:49:40 +0900 Subject: [PATCH] a spy method should be enumerable --- packages/enzyme/src/Utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/enzyme/src/Utils.js b/packages/enzyme/src/Utils.js index 571a64107..644bf0b1a 100644 --- a/packages/enzyme/src/Utils.js +++ b/packages/enzyme/src/Utils.js @@ -254,7 +254,7 @@ export function spyMethod(instance, methodName) { } Object.defineProperty(instance, methodName, { configurable: true, - enumerable: false, + enumerable: !descriptor || !!descriptor.enumerable, value(...args) { const result = originalMethod.apply(this, args); lastReturnValue = result;