From 4a09d9ddb343fde1eb1c04279bef6a406bf6c1ac Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Thu, 31 May 2018 08:53:57 +0200 Subject: add failing test --- spec/spec/runner.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec') diff --git a/spec/spec/runner.js b/spec/spec/runner.js index 2e1007b..e90bb57 100644 --- a/spec/spec/runner.js +++ b/spec/spec/runner.js @@ -253,6 +253,18 @@ describe('SVG.Runner', function () { expect(initFn).toHaveBeenCalled() expect(runFn).toHaveBeenCalledWith(1) }) + + it('does behave correctly at the end of reversed loop', function () { + var spy = jasmine.createSpy('stepper') + var runner = new SVG.Runner(1000).loop(6, true) + runner.queue(null, spy) + + // the 6th loop is reversed + runner.step(5750) + expect(spy).toHaveBeenCalledWith(0.25) + runner.step(250) + expect(spy).toHaveBeenCalledWith(0) + }) }) describe('active()', function () { -- cgit v1.2.3