<commit_before>/* eslint object-curly-newline: 0, max-len: 0 */
const fs = require('fs');
const path = require('path');
const CDP = require('chrome-remote-interface');

const injectMediator = `
(function (win) {
  win.sessionStorage.setItem('aw', '');

  win.awMediator = {
    emit(name, data = '') {
      const json = JSON.stringify({ name, data });
      win.sessionStorage.setItem('aw', json);
    },
  };
}(window));
`;

function getContent(filePath) {
  return fs.readFileSync(filePath, 'utf-8');
}

module.exports = async function connect(argv, files, debugging) {
  const client = await CDP(argv.client);
  const { DOM, DOMStorage, Console, Network, Page, Runtime } = client;

  const { bail, useColors, reporter, ui, timeout } = argv.mocha;
  const injectMochaOptions = `window.mochaOptions = ${JSON.stringify({
    bail,
    useColors,
    reporter,
    ui,
    timeout,
  })}`;
  console.log(argv.mocha);
  const injectAwFiles = `window.awFiles = ${JSON.stringify(files)}`;
  const injectAwDevtools = `window.awDevtools = ${JSON.stringify(
    argv.chrome.devtools,
  )}`;
  const injectAwDebugging = `window.awDebugging = ${JSON.stringify(debugging)}`;

  await Promise.all([
    DOM.enable(),
    DOMStorage.enable(),<commit_msg>chore: remove console log<commit_after>/* eslint object-curly-newline: 0, max-len: 0 */
const fs = require('fs');
const path = require('path');
const CDP = require('chrome-remote-interface');

const injectMediator = `
(function (win) {
  win.sessionStorage.setItem('aw', '');

  win.awMediator = {
    emit(name, data = '') {
      const json = JSON.stringify({ name, data });
      win.sessionStorage.setItem('aw', json);
    },
  };
}(window));
`;

function getContent(filePath) {
  return fs.readFileSync(filePath, 'utf-8');
}

module.exports = async function connect(argv, files, debugging) {
  const client = await CDP(argv.client);
  const { DOM, DOMStorage, Console, Network, Page, Runtime } = client;

  const { bail, useColors, reporter, ui, timeout } = argv.mocha;
  const injectMochaOptions = `window.mochaOptions = ${JSON.stringify({
    bail,
    useColors,
    reporter,
    ui,
    timeout,
  })}`;

  const injectAwFiles = `window.awFiles = ${JSON.stringify(files)}`;
  const injectAwDevtools = `window.awDevtools = ${JSON.stringify(
    argv.chrome.devtools,
  )}`;
  const injectAwDebugging = `window.awDebugging = ${JSON.stringify(debugging)}`;

  await Promise.all([
    DOM.enable(),
    DOMStorage.enable(),
{'fraction_non_alphanumeric': 0.16181229773462782, 'fraction_numerical': 0.0024271844660194173, 'mean_word_length': 4.006072874493927, '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': '6171526', 'n_tokens_mistral': 831, 'n_tokens_neox': 808, 'n_words': 177}