Skip to content

Commit

Permalink
Change a getter to a method
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed Nov 6, 2017
1 parent 368899a commit 5a96df5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/enzyme-test-suite/test/Utils-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ describe('Utils', () => {
const spy = spyMethod(target, 'incrementAndGet');
target.incrementAndGet();
target.incrementAndGet();
expect(spy.lastReturnValue).to.equal(3);
expect(spy.getLastReturnValue()).to.equal(3);
spy.restore();
expect(target.incrementAndGet).to.equal(original);
expect(target.incrementAndGet()).to.equal(4);
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme/src/ShallowWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class ShallowWrapper {
if (props) this[UNRENDERED] = cloneElement(adapter, this[UNRENDERED], props);
this[RENDERER].render(this[UNRENDERED], nextContext);
if (spy) {
shouldRender = spy.lastReturnValue;
shouldRender = spy.getLastReturnValue();
spy.restore();
}
if (
Expand Down Expand Up @@ -357,7 +357,7 @@ class ShallowWrapper {
}
instance.setState(state, callback);
if (spy) {
shouldRender = spy.lastReturnValue;
shouldRender = spy.getLastReturnValue();
spy.restore();
}
if (
Expand Down
2 changes: 1 addition & 1 deletion packages/enzyme/src/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export function spyMethod(instance, methodName) {
/* eslint-enable no-param-reassign */
}
},
get lastReturnValue() {
getLastReturnValue() {
return lastReturnValue;
},
};
Expand Down

0 comments on commit 5a96df5

Please sign in to comment.