(time, tween1Expect, tween2Expect)
| 115 | const tween2 = new Tween(jest.fn(), 10, 20, 2000) |
| 116 | const multi = new MultiTween([tween1, tween2], undefined, 0, 'linear', 4) |
| 117 | function testTime(time, tween1Expect, tween2Expect) { |
| 118 | const lastCallVal = mockFn => mockFn.mock.calls[mockFn.mock.calls.length - 1][0] |
| 119 | multi.gotoElapsedTime(time) |
| 120 | expect(lastCallVal(tween1.callback)).toBeCloseTo(tween1Expect) |
| 121 | expect(lastCallVal(tween2.callback)).toBeCloseTo(tween2Expect) |
| 122 | } |
| 123 | testTime(500, 5, 12.5) |
| 124 | testTime(2600, 6, 13) |
| 125 | testTime(5500, 10, 17.5) |
no test coverage detected