<commit_before>window = require('jsdom').jsdom().createWindow();
document = window.document;
jQuery = require('jquery');
$ = jQuery;
jqueryJasmine = require('jasmine-jquery');

require('../jquery.li18n');

describe('$.li18n', function() {
  beforeEach(function() {
    $.li18n.reset();
  });

  describe('default current locale', function() {
    it('is "en"', function() {
      expect($.li18n.currentLocale).toBe('en');
    });
  });

  describe('default translations', function() {
    it('is an empty object', function() {
      expect($.li18n.translations).toEqual({});
    });
  });

  it('has a version', function() {
    expect($.li18n.version).toMatch(/\d\.\d.\d/);
  });

  describe('._translate', function() {
    describe('if curren locale is missing', function() {
      it('throws an error', function() {
        $.li18n.currentLocale = null;
        expect(function() {
          $.li18n._translate('spam');
        }).toThrow('Missing current locale');
      });
    });

    describe('if translations are missing', function() {
      it('throws an error', function() {
        $.li18n.translations = null;
        expect(function() {
          $.li18n._translate('spam');
        }).toThrow('Missing translations');
      });
    });

    describe('if translations for current locale is missing', function() {<commit_msg>Fixed typo in spec<commit_after>window = require('jsdom').jsdom().createWindow();
document = window.document;
jQuery = require('jquery');
$ = jQuery;
jqueryJasmine = require('jasmine-jquery');

require('../jquery.li18n');

describe('$.li18n', function() {
  beforeEach(function() {
    $.li18n.reset();
  });

  describe('default current locale', function() {
    it('is "en"', function() {
      expect($.li18n.currentLocale).toBe('en');
    });
  });

  describe('default translations', function() {
    it('is an empty object', function() {
      expect($.li18n.translations).toEqual({});
    });
  });

  it('has a version', function() {
    expect($.li18n.version).toMatch(/\d\.\d.\d/);
  });

  describe('._translate', function() {
    describe('if curren locale is missing', function() {
      it('throws an error', function() {
        $.li18n.currentLocale = null;
        expect(function() {
          $.li18n._translate('spam');
        }).toThrow('Missing current locale');
      });
    });

    describe('if translations are missing', function() {
      it('throws an error', function() {
        $.li18n.translations = null;
        expect(function() {
          $.li18n._translate('spam');
        }).toThrow('Missing translations');
      });
    });

    describe('if translations for current locale are missing', function() {
{'fraction_non_alphanumeric': 0.19463087248322147, 'fraction_numerical': 0.014914243102162566, 'mean_word_length': 3.1276923076923078, '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': '5492958', 'n_tokens_mistral': 823, 'n_tokens_neox': 778, 'n_words': 159}