<commit_before>import { assert } from 'chai';
import sinon from 'sinon';
import Print from '../../src/Print';

describe('Animation::Print', () => {
  it('Should properly accept options object', () => {
    let animation = new Print({interval: 500});

    assert.equal(animation.get('interval'), 500);
  });

  it('Should properly get/set interval', () => {
    let animation = new Print();

    assert.equal(animation.getInterval(), 100);
    assert.instanceOf(animation.setInterval(1000), Print);
    assert.equal(animation.getInterval(), 1000);
  });

  it('Should properly check if animation is with random interval', () => {
    let animation = new Print();

    assert.ok(animation.isRandom());
    assert.instanceOf(animation.setRandom(false), Print);
    assert.notOk(animation.isRandom());
  });

  it('Should properly call the animate() method with random option', () => {
    let animation = new Print();
    let cb = sinon.spy();

    animation.animate('test', cb);

    setTimeout(() => {
      assert.equal(cb.getCall(0).args[0], 'test');
    }, 200);
  });

  it('Should properly call the animate() method without random option', () => {
    let animation = new Print({random: false});
    let cb = sinon.spy();

    animation.animate('test', cb);

    setTimeout(() => {
      assert.equal(cb.getCall(0).args[0], 'test');
    }, 200);
  });
});<commit_msg>test(animation): Fix tests<commit_after>import { assert } from 'chai';
import sinon from 'sinon';
import Rectangle from 'kittik-shape-rectangle';
import Print from '../../src/Print';

describe('Animation::Print', () => {
  it('Should properly call the animate() method', done => {
    let animation = new Print();
    let shape = new Rectangle();
    let mock = sinon.mock(animation);

    mock.expects('animateProperty').once().returns(Promise.resolve());

    animation.animate(shape).then(() => {
      mock.verify();
      done();
    });
  });

  it('Should properly animate property', done => {
    let animation = new Print({duration: 1});
    let shape = new Rectangle();
    let mock = sinon.mock(animation);

    mock.expects('emit').atLeast(1).withArgs('tick');

    animation.animate(shape).then(() => {
      mock.verify();
      done();
    });
  });
});
{'fraction_non_alphanumeric': 0.18535060294774452, 'fraction_numerical': 0.012952210808396605, 'mean_word_length': 3.5621181262729125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '321526', 'n_tokens_mistral': 692, 'n_tokens_neox': 645, 'n_words': 163}