aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2017-02-25 16:08:55 -0500
committerRémi Tétreault <tetreault.remi@gmail.com>2017-02-25 16:59:55 -0500
commitc1736e683178a7b03fa70044c5fa69384ba560d0 (patch)
treefc9e7d1e6284db8b172ab8bda48f0acd6e55211b
parent6327512f1afe304891f5fb5e59afc15e55d70ba1 (diff)
downloadsvg.js-c1736e683178a7b03fa70044c5fa69384ba560d0.tar.gz
svg.js-c1736e683178a7b03fa70044c5fa69384ba560d0.zip
Add tests for when the user call stop/finish in during callback
-rw-r--r--spec/spec/fx.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/spec/fx.js b/spec/spec/fx.js
index bde3c23..abc49fd 100644
--- a/spec/spec/fx.js
+++ b/spec/spec/fx.js
@@ -1605,6 +1605,18 @@ describe('FX', function() {
expect(fx.pos).toBe(1) // It should end not reversed, which mean the position is expected to be 1
// ((9-1)-6) is even, the -1 is because we do not want reversed to be toggled after the last loop
})
+
+ it('should not throw an error when stop is called in a during callback', function () {
+ fx.move(100,100).start()
+ fx.during(function () {this.stop()})
+ expect(fx.step.bind(fx)).not.toThrow()
+ })
+
+ it('should not throw an error when finish is called in a during callback', function () {
+ fx.move(100,100).start()
+ fx.during(function () {this.finish()})
+ expect(fx.step.bind(fx)).not.toThrow()
+ })
})
})