<commit_before>
var it = window.it;
var describe = window.describe;
var expect = window.expect;

var i18n = window.i18n;

var sinon = window.sinon;

describe('i18n', function () {
    'use strict';

    it('exists', function () {

        expect(i18n).not.toEqual(null);

    });

    describe('setResource', function () {

        it('sets the resource', function () {

            var resource = {abc: 'abc string'};

            i18n.setResource(resource);

            expect(i18n.resource).toBe(resource);
        });

        it('resets entire resource', function () {

            var resource1 = {abc: 'abc string'};
            var resource2 = {def: 'def string'};

            i18n.setResource(resource1);
            i18n.setResource(resource2);

            expect(i18n.resource).toBe(resource2);
        });
    });

    describe('t', function () {

        it('can translate the existing keys', function () {
            var resource = {abc: 'abc string'};

            i18n.setResource(resource);

            expect(i18n.t('abc')).toBe('abc string');
        });

        it('returns the key itself if the corresponding resource doesn\'t exist', function () {
            var resource = {abc: 'abc string'};

            i18n.setResource(resource);

            expect(i18n.t('nonexistent.key')).toBe('nonexistent.key');
        });

    });

    describe('scan', function () {

        it('calls scanTTag, scanTText and scanTAttr and return aggregated objects of the combination of these methods results', function () {

            var stub1 = sinon.stub(i18n, 'scanTTag');
            var stub2 = sinon.stub(i18n, 'scanTText');
            var stub3 = sinon.stub(i18n, 'scanTAttr');

            stub1.returns(5);
            stub2.returns(11);
            stub3.returns(13);

            var scanResult = i18n.scan();

            expect(scanResult['t-tag']).toBe(5);
            expect(scanResult['t-text']).toBe(11);
            expect(scanResult['t-attr']).toBe(13);

            stub1.restore();
            stub2.restore();
            stub3.restore();
        });

    });

});
<commit_msg>Put placeholder describe<commit_after>
var it = window.it;
var describe = window.describe;
var expect = window.expect;

var i18n = window.i18n;

var sinon = window.sinon;

describe('i18n', function () {
    'use strict';

    it('exists', function () {

        expect(i18n).not.toEqual(null);

    });

    describe('setResource', function () {

        it('sets the resource', function () {

            var resource = {abc: 'abc string'};

            i18n.setResource(resource);

            expect(i18n.resource).toBe(resource);
        });

        it('resets entire resource', function () {

            var resource1 = {abc: 'abc string'};
            var resource2 = {def: 'def string'};

            i18n.setResource(resource1);
            i18n.setResource(resource2);

            expect(i18n.resource).toBe(resource2);
        });
    });

    describe('t', function () {

        it('can translate the existing keys', function () {
            var resource = {abc: 'abc string'};

            i18n.setResource(resource);

            expect(i18n.t('abc')).toBe('abc string');
        });

        it('returns the key itself if the corresponding resource doesn\'t exist', function () {
            var resource = {abc: 'abc string'};

            i18n.setResource(resource);

            expect(i18n.t('nonexistent.key')).toBe('nonexistent.key');
        });

    });

    describe('scan', function () {

        it('calls scanTTag, scanTText and scanTAttr and return aggregated objects of the combination of these methods results', function () {

            var stub1 = sinon.stub(i18n, 'scanTTag');
            var stub2 = sinon.stub(i18n, 'scanTText');
            var stub3 = sinon.stub(i18n, 'scanTAttr');

            stub1.returns(5);
            stub2.returns(11);
            stub3.returns(13);

            var scanResult = i18n.scan();

            expect(scanResult['t-tag']).toBe(5);
            expect(scanResult['t-text']).toBe(11);
            expect(scanResult['t-attr']).toBe(13);

            stub1.restore();
            stub2.restore();
            stub3.restore();
        });

    });


    describe('scanTTag', function () {
    });


    describe('scanTText', function () {
    });


    describe('scanTAttr', function () {
    });


    describe('setAvailableLanguages', function () {
    });


    describe('setLanguage', function () {
    });


    describe('pickUsableLanguage', function () {
    });


    describe('loadScript', function () {
    });


    describe('loadJSON', function () {
    });

});

{'fraction_non_alphanumeric': 0.1517684887459807, 'fraction_numerical': 0.024866023579849947, 'mean_word_length': 2.0921139827700466, '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': '576148', 'n_tokens_mistral': 1442, 'n_tokens_neox': 1347, 'n_words': 278}