Skip to content

Commit eb37d6b

Browse files
committed
Change a getter to a method
1 parent 92357de commit eb37d6b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/enzyme-test-suite/test/Utils-spec.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ describe('Utils', () => {
570570
const spy = spyMethod(target, 'incrementAndGet');
571571
target.incrementAndGet();
572572
target.incrementAndGet();
573-
expect(spy.lastReturnValue).to.equal(3);
573+
expect(spy.getLastReturnValue()).to.equal(3);
574574
spy.restore();
575575
expect(target.incrementAndGet).to.equal(original);
576576
expect(target.incrementAndGet()).to.equal(4);

packages/enzyme/src/ShallowWrapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class ShallowWrapper {
288288
if (props) this[UNRENDERED] = cloneElement(adapter, this[UNRENDERED], props);
289289
this[RENDERER].render(this[UNRENDERED], nextContext);
290290
if (spy) {
291-
shouldRender = spy.lastReturnValue;
291+
shouldRender = spy.getLastReturnValue();
292292
spy.restore();
293293
}
294294
if (
@@ -371,7 +371,7 @@ class ShallowWrapper {
371371
}
372372
instance.setState(state, callback);
373373
if (spy) {
374-
shouldRender = spy.lastReturnValue;
374+
shouldRender = spy.getLastReturnValue();
375375
spy.restore();
376376
}
377377
if (

packages/enzyme/src/Utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export function spyMethod(instance, methodName) {
292292
/* eslint-enable no-param-reassign */
293293
}
294294
},
295-
get lastReturnValue() {
295+
getLastReturnValue() {
296296
return lastReturnValue;
297297
},
298298
};

0 commit comments

Comments
 (0)