<commit_before>﻿(function () {
    'use strict';

    var worker = null;

    describe("WebWorker", function () {

        it("should be defined", function () {
            expect(WebWorker).toBeDefined();
            return;
        });

        describe("instance", function () {
            
            afterEach(function () {
                worker = null;
                return;
            });

            describe("constructor", function () {

                it("should accept string selector if first argument is string and if the element exists", function () {
                    
                    worker = new WebWorker("#test-worker-script-elem");
                    
                    expect(worker).not.toBe(null);

                    return;
                });

                it("should accept string URL if first argument is string and an element of same selector does not exist", function () {
                    
                    worker = new WebWorker("/js/example-worker.js");
                    
                    expect(worker).not.toBe(null);

                    return;
                });

                return;
            });

            return;
        });

        describe("static", function () {
        });

        return;
    });

    return;
})();<commit_msg>Update specs<commit_after>﻿(function () {
    'use strict';

    var worker = null;

    describe("WebWorker", function () {

        it("should be defined", function () {
            expect(WebWorker).toBeDefined();
            return;
        });

        describe("instance", function () {
            
            afterEach(function () {
                if (worker) {
                    worker.terminate();
                }
                worker = null;
                return;
            });

            describe("constructor", function () {

                it("should accept string selector if first argument is string and if the element exists", function () {
                    worker = new WebWorker("#test-worker-script-elem");
                    expect(worker).not.toBe(null);
                    return;
                });

                it("should accept string URL if first argument is string and an element of same selector does not exist", function () {
                    worker = new WebWorker("/js/example-worker.js");
                    expect(worker).not.toBe(null);
                    return;
                });

                it("should support terminating the worker", function () {
                    worker = new WebWorker("/js/example-worker.js");
                    spyOn(worker, 'terminate');
                    worker.terminate();
                    expect(worker.terminate).toHaveBeenCalled();
                    return;
                });

                it("should trigger the WORKER_LOADED event once the worker has loaded", function (done) {

                    var Listeners = {
                        WORKER_LOADED: function () {
                            expect(Listeners.WORKER_LOADED).toHaveBeenCalled();
                            done();
                            return;
                        }
                    };

                    spyOn(Listeners, 'WORKER_LOADED').and.callThrough();

                    worker = new WebWorker("/js/example-worker.js");
                    worker.on(WebWorker.Event.WORKER_LOADED, Listeners.WORKER_LOADED);

                    return;
                });

                return;
            });

            return;
        });

        describe("static", function () {
        });

        return;
    });

    return;
})();
{'fraction_non_alphanumeric': 0.10780567685589519, 'fraction_numerical': 0.0, 'mean_word_length': 1.1520845566647093, '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': '2622459', 'n_tokens_mistral': 860, 'n_tokens_neox': 772, 'n_words': 189}