| 1 |
class Foo { |
| 2 |
foo = 0; |
| 3 |
|
| 4 |
test(other) { |
| 5 |
return [ |
| 6 |
this.foo++, |
| 7 |
this.foo, |
| 8 |
++this.foo, |
| 9 |
this.foo, |
| 10 |
other.obj.foo++, |
| 11 |
other.obj.foo, |
| 12 |
++other.obj.foo, |
| 13 |
other.obj.foo, |
| 14 |
]; |
| 15 |
} |
| 16 |
} |
| 17 |
|
| 18 |
const f = new Foo; |
| 19 |
const results = f.test({ obj: f }); |
| 20 |
expect(results[0]).toBe(0); |
| 21 |
expect(results[1]).toBe(1); |
| 22 |
expect(results[2]).toBe(2); |
| 23 |
expect(results[3]).toBe(2); |
| 24 |
expect(results[4]).toBe(2); |
| 25 |
expect(results[5]).toBe(3); |
| 26 |
expect(results[6]).toBe(4); |
| 27 |
expect(results[7]).toBe(4); |