Add update callback

This commit is contained in:
houfio
2020-07-24 23:41:59 +02:00
parent c13803082c
commit cb61da5bef
2 changed files with 26 additions and 0 deletions

View File

@@ -252,6 +252,23 @@ suite('Tween', function () {
}, 50);
});
test('tween to call update callback', function (done) {
var stage = addStage();
var updateCount = 0;
stage.to({
x: 10,
duration: 0.01,
onUpdate: function () {
updateCount++;
},
onFinish: function () {
assert(updateCount === 3, 'updateCount should equal 3');
done();
},
});
});
suite('tween array with different length', function () {
test('prepare array closed', function () {
var start = [0, 0, 10, 0, 10, 10];