Add a test for zero-duration case.

This commit is contained in:
Michael Casebolt 2017-10-29 11:24:24 -07:00
parent edc42b22c0
commit daec732aa6

View File

@ -1125,6 +1125,20 @@
TWEEN.update(150);
test.equal(t.isPlaying(), false);
test.done();
},
'A zero-duration tween finishes at its starting time without an error.': function(test) {
TWEEN.removeAll();
let object = {x: 0};
var t = new TWEEN.Tween(object).to({x:1}, 0);
t.start(0);
TWEEN.update(0);
test.equal(t.isPlaying(), false);
test.equal(object.x, 1);
test.done();
},