<commit_before><commit_msg>add chrome mock<commit_after>'use strict'

var chrome = require('sinon-chrome')
var gb = global || window

beforeAll(function() {

  // make mock chrome global
  gb.chrome = chrome

  chrome.runtime.id = 'SALADICT_TEST_ID'

  // stub i18n messages
  var zhLocale = require('../../src/_locales/zh_CN/messages.json')

  for (var n in zhLocale) {
    if (zhLocale.hasOwnProperty(n)) {
      chrome.i18n.getMessage.withArgs(n).returns(zhLocale[n].message)
    }
  }

})

{'fraction_non_alphanumeric': 0.1440162271805274, 'fraction_numerical': 0.008113590263691683, 'mean_word_length': 3.574074074074074, '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': '6312744', 'n_tokens_mistral': 184, 'n_tokens_neox': 172, 'n_words': 34}