<commit_before>/* eslint no-console:0 */

// mocha/jsdom setup from:
// http://reactjsnews.com/testing-in-react/

import jsdom from 'jsdom';
import chai from 'chai';
import chaiEnzyme from 'chai-enzyme';

// https://github.com/producthunt/chai-enzyme
chai.use(chaiEnzyme());

// setup the simplest document possible
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>');

// get the window object out of the document
const win = doc.defaultView;

// set globals for mocha that make access to document and window feel
// natural in the test environment
global.document = doc;
global.window = win;

// from mocha-jsdom https://github.com/rstacruz/mocha-jsdom/blob/master/index.js#L80
function propagateToGlobal(window) {
  for (const key of Object.keys(window)) {
    if (key in global) {
      // eslint-disable-next-line no-continue
      continue;
    }

    global[key] = window[key];
  }
}

// take all properties of the window object and also attach it to the
// mocha global object
propagateToGlobal(win);<commit_msg>Replace syntax disallowed by eslint config<commit_after>/* eslint no-console:0 */

// mocha/jsdom setup from:
// http://reactjsnews.com/testing-in-react/

import jsdom from 'jsdom';
import chai from 'chai';
import chaiEnzyme from 'chai-enzyme';

// https://github.com/producthunt/chai-enzyme
chai.use(chaiEnzyme());

// setup the simplest document possible
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>');

// get the window object out of the document
const win = doc.defaultView;

// set globals for mocha that make access to document and window feel
// natural in the test environment
global.document = doc;
global.window = win;

// from mocha-jsdom https://github.com/rstacruz/mocha-jsdom/blob/master/index.js#L80
function propagateToGlobal(window) {
  Object.keys(window).forEach((key) => {
    if (key in global) {
      return;
    }

    global[key] = window[key];
  });
}

// take all properties of the window object and also attach it to the
// mocha global object
propagateToGlobal(win);
{'fraction_non_alphanumeric': 0.13138686131386862, 'fraction_numerical': 0.00291970802919708, 'mean_word_length': 3.7925407925407923, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 4, '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': '6232185', 'n_tokens_mistral': 676, 'n_tokens_neox': 649, 'n_words': 194}