Skip to content

Commit b5281db

Browse files
committed
[enzyme] Remove || in invoke logic
1 parent 14d3958 commit b5281db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/enzyme/src/ReactWrapper.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,9 @@ 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 wrapAct = this[RENDERER].act || function wrapAct(fn) { return fn(); };
845-
const response = wrapAct(() => handler(...args));
844+
const response = typeof this[RENDERER].act === 'function'
845+
? this[RENDERER].act(() => handler(...args))
846+
: handler(...args);
846847
this[ROOT].update();
847848
return response;
848849
};

0 commit comments

Comments
 (0)