Skip to content

Commit acfcf0b

Browse files
committed
Revert "[enzyme] Remove || in invoke logic"
This reverts commit b5281db.
1 parent b5281db commit acfcf0b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/enzyme/src/ReactWrapper.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,8 @@ class ReactWrapper {
841841
throw new TypeError('ReactWrapper::invoke() requires the name of a prop whose value is a function');
842842
}
843843
return (...args) => {
844-
const response = typeof this[RENDERER].act === 'function'
845-
? this[RENDERER].act(() => handler(...args))
846-
: handler(...args);
844+
const wrapAct = this[RENDERER].act || function wrapAct(fn) { return fn(); };
845+
const response = wrapAct(() => handler(...args));
847846
this[ROOT].update();
848847
return response;
849848
};

0 commit comments

Comments
 (0)