Skip to content

Commit 6fa1e9a

Browse files
committed
a spy method should be enumerable
1 parent 899f222 commit 6fa1e9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/enzyme/src/Utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export function spyMethod(instance, methodName) {
254254
}
255255
Object.defineProperty(instance, methodName, {
256256
configurable: true,
257-
enumerable: false,
257+
enumerable: !descriptor || !!descriptor.enumerable,
258258
value(...args) {
259259
const result = originalMethod.apply(this, args);
260260
lastReturnValue = result;

0 commit comments

Comments
 (0)