now I'm using only non-legacy

This commit is contained in:
Francisco Dans 2015-08-05 12:49:02 +02:00
parent 288321b383
commit 5be36ca15a

View File

@ -2,12 +2,13 @@ var torque = require('../lib/torque');
var sinon = require('sinon');
require('phantomjs-polyfill');
asyncTest('time moves', function(assert) {
test('time moves', function(assert) {
var done = assert.async();
var animator = new torque.Animator(function(){}, {steps: 500, animationDuration: 10});
animator.start();
setTimeout(function(){
assert.notEqual(animator._time, 0);
QUnit.start();
done();
}, 100)
animator.pause();
});
@ -58,25 +59,27 @@ test("altering steps should rescale", function(assert){
assert.ok(animator.rescale.calledOnce);
});
asyncTest("tick should set time to zero if steps are bigger than range", function(assert){
test("tick should set time to zero if steps are bigger than range", function(assert){
var done = assert.async();
var animator = new torque.Animator(function(){}, {steps: 500, animationDuration: 10});
animator.start();
setTimeout(function(){
animator._time = 0;
animator.step(800);
assert.ok(animator.step() < 800);
QUnit.start();
done();
}, 200);
animator.pause();
});
asyncTest("tick should pause animation on end if loop is disabled", function(assert){
test("tick should pause animation on end if loop is disabled", function(assert){
var done = assert.async();
var animator = new torque.Animator(function(){}, {steps: 500, animationDuration: 10});
animator.options.loop = false;
animator.toggle();
animator.step(600);
setTimeout(function(){
assert.equal(animator._time,animator.options.animationDuration);
QUnit.start();
done();
}, 200);
});