<commit_before>/**
 * Running tests
 *
 * By default tests are run locally on chrome headless
 * $ node test/e2e/runner.js
 *
 * You can run a specific test by passing it, or pass various tests
 * $ node test/e2e/runner.js test/e2e/specs/basic.js test/e2e/specs/redirect.js
 *
 * You can specify a list of browsers to run from nightwatch.config.js with -e separated by a comma
 * $ node test/e2e/runner.js -e safari,firefox
 *
 * If you are already running the dev server with `yarn run serve`, you can pass the --dev option to avoid launching the server
 * $ node test/e2e/runner.js --dev
 *
 * __For maintainers only__
 * You can trigger tests on Browserstack on other browsers by passing the --local option
 * It's also required to pass the list of browsers to test on to avoid launching too many tests. Available options are located inside nightwatch.browserstack.js
 * $ node test/e2e/runner.js --local -e ie,chrome50
 */

require('dotenv').config()
const { resolve } = require('path')
const Nightwatch = require('nightwatch')
const args = process.argv.slice(2)

// if we are running yarn dev locally, we can pass --dev to avoid launching another server instance
const server =
  args.indexOf('--dev') > -1 ? null : require('../../examples/server')

// allow running browserstack local
const isLocal = args.indexOf('--local') > -1

const DEFAULT_CONFIG = './nightwatch.json'
const NW_CONFIG = isLocal
  ? resolve(__dirname, './nightwatch.browserstack.js')
  : resolve(__dirname, './nightwatch.config.js')

// add a configuration by default if not provided
// add a configuration by default if not provided
if (args.indexOf('-c') < 0) {
  args.push('-c', NW_CONFIG)
  // check if multiple envs are provided. The way Nightwatch works
  // requires to explicitely provide the conf
  const envs = args[args.indexOf('-e') + 1]
  if (envs && envs.indexOf(',') > -1) {
    console.warn(
      `Specify the conf when providing multiple browsers:\n$ yarn run test:e2e ${args.join(
        ' '
      )} -c ${NW_CONFIG}`
    )
    process.exit(1)
  }
} else if (isLocal) {<commit_msg>chore(test): improve e2e test runner warning (#2806)<commit_after>/**
 * Running tests
 *
 * By default tests are run locally on chrome headless
 * $ node test/e2e/runner.js
 *
 * You can run a specific test by passing it, or pass various tests
 * $ node test/e2e/runner.js test/e2e/specs/basic.js test/e2e/specs/redirect.js
 *
 * You can specify a list of browsers to run from nightwatch.config.js with -e separated by a comma
 * $ node test/e2e/runner.js -e safari,firefox
 *
 * If you are already running the dev server with `yarn run serve`, you can pass the --dev option to avoid launching the server
 * $ node test/e2e/runner.js --dev
 *
 * __For maintainers only__
 * You can trigger tests on Browserstack on other browsers by passing the --local option
 * It's also required to pass the list of browsers to test on to avoid launching too many tests. Available options are located inside nightwatch.browserstack.js
 * $ node test/e2e/runner.js --local -e ie,chrome50
 */

require('dotenv').config()
const { resolve } = require('path')
const Nightwatch = require('nightwatch')
const args = process.argv.slice(2)

// if we are running yarn dev locally, we can pass --dev to avoid launching another server instance
const server =
  args.indexOf('--dev') > -1 ? null : require('../../examples/server')

// allow running browserstack local
const isLocal = args.indexOf('--local') > -1

const DEFAULT_CONFIG = './nightwatch.json'
const NW_CONFIG = isLocal
  ? resolve(__dirname, './nightwatch.browserstack.js')
  : resolve(__dirname, './nightwatch.config.js')

// add a configuration by default if not provided
// add a configuration by default if not provided
if (args.indexOf('-c') < 0) {
  // check if multiple envs are provided. The way Nightwatch works
  // requires to explicitely provide the conf
  const envs = args[args.indexOf('-e') + 1]
  if (envs && envs.indexOf(',') > -1) {
    console.warn(
      `Specify the conf when providing multiple browsers:\n$ yarn run test:e2e ${args.join(
        ' '
      )} -c ${NW_CONFIG}`
    )
    process.exit(1)
  }
  args.push('-c', NW_CONFIG)
} else if (isLocal) {
{'fraction_non_alphanumeric': 0.11871275327771157, 'fraction_numerical': 0.009296781883194279, 'mean_word_length': 3.449628844114528, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2440729', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1250, 'n_words': 482}