<commit_before>'use strict';

describe('Stimuli.core.Recorder', function() {

    var a, recorder, clock;

    beforeEach(function(){
        var DeferableClass = function() {};


        Stimuli.core.Class.mix(DeferableClass, Stimuli.core.Deferable);

        a = new DeferableClass();

        recorder = new Stimuli.core.Recorder();

    });

    afterEach(function() {
        a = null;
        recorder = null;
    });

    it('should be able to record and replay a entire sequence of a deferable', function() {
        var clock = sinon.useFakeTimers();
        var str = '';
        var previousTime;

        a.synchronize(recorder);

        recorder
            .start('foobar');

        a
            .then(function() {
                str += '1';
            })
            .sleep(1)
            .then(function() {
                str += '2';
            })
            .sleep(2)
            .then(function() {
                str += '3';
            });


        recorder
            .stop('foobar')
            .replay('foobar', 2);

        clock.tick(9);
        expect(str).to.be('123123123');
        clock.restore();
    });

    it('should be able to record two sequences in a deferable even if they cross each others', function() {
        var clock = sinon.useFakeTimers();
        var str = '';
        var previousTime;

        a.synchronize(recorder);

        recorder.start('foobar');

        a
        .then(function() {
            str += '1';
        })
        .sleep(1)
        .then(function() {
            str += '2';
        });

        recorder.start('foobar2');

        a
        .sleep(2)
        .then(function() {
            str += '3';
        });


        recorder
            .stop('foobar')
            .stop('foobar2')
            .replay('foobar', 2)
            .replay('foobar2', 2)


        clock.tick(13);
        expect(str).to.be('12312312333');
        clock.restore();
    });

});
<commit_msg>lint: missing comma in recorder spec<commit_after>'use strict';

describe('Stimuli.core.Recorder', function() {

    var a, recorder, clock;

    beforeEach(function(){
        var DeferableClass = function() {};


        Stimuli.core.Class.mix(DeferableClass, Stimuli.core.Deferable);

        a = new DeferableClass();

        recorder = new Stimuli.core.Recorder();

    });

    afterEach(function() {
        a = null;
        recorder = null;
    });

    it('should be able to record and replay a entire sequence of a deferable', function() {
        var clock = sinon.useFakeTimers();
        var str = '';
        var previousTime;

        a.synchronize(recorder);

        recorder
            .start('foobar');

        a
            .then(function() {
                str += '1';
            })
            .sleep(1)
            .then(function() {
                str += '2';
            })
            .sleep(2)
            .then(function() {
                str += '3';
            });


        recorder
            .stop('foobar')
            .replay('foobar', 2);

        clock.tick(9);
        expect(str).to.be('123123123');
        clock.restore();
    });

    it('should be able to record two sequences in a deferable even if they cross each others', function() {
        var clock = sinon.useFakeTimers();
        var str = '';
        var previousTime;

        a.synchronize(recorder);

        recorder.start('foobar');

        a
        .then(function() {
            str += '1';
        })
        .sleep(1)
        .then(function() {
            str += '2';
        });

        recorder.start('foobar2');

        a
        .sleep(2)
        .then(function() {
            str += '3';
        });


        recorder
            .stop('foobar')
            .stop('foobar2')
            .replay('foobar', 2)
            .replay('foobar2', 2);


        clock.tick(13);
        expect(str).to.be('12312312333');
        clock.restore();
    });

});

{'fraction_non_alphanumeric': 0.14517766497461929, 'fraction_numerical': 0.01979695431472081, 'mean_word_length': 1.4177914110429448, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '91346', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1130, 'n_words': 241}