pcottle.learnGitBranching/__tests__/animation.spec.js
2023-09-11 11:19:28 +02:00

29 lines
728 B
JavaScript

var AnimationModule = require('../src/js/visuals/animation/index');
var PromiseAnimation = AnimationModule.PromiseAnimation;
var Animation = AnimationModule.Animation;
var Q = require('q');
describe('Promise animation', function() {
it('Will execute the closure', function() {
var value = 1;
var closure = function() {
value++;
};
var animation = new PromiseAnimation({
deferred: Q.defer(),
closure: closure
});
animation.play();
expect(value).toBe(1);
});
it('also takes animation packs', function() {
var value = 0;
var animation = new PromiseAnimation({
animation: function() { value++; }
});
animation.play();
expect(value).toBe(1);
});
});