<commit_before>import { execFileSync } from 'child_process'
import { join } from 'path'

const cmd = 'node_modules/.bin/cucumber-js'

type RunOptionalOptions = {
  '--name'?: string
}
type RunOptions = {
  colorsEnabled?: boolean
}
type FinalRunOptions = RunOptionalOptions & Required<RunOptions>

export const run = (
  fileName: string,
  options: RunOptions & RunOptionalOptions = {}
): string => {
  const finalOptions: FinalRunOptions = { colorsEnabled: false, ...options }
  const args = [
    '--format',
    join(__dirname, '..', 'lib', 'src'),
    '--format-options',
    JSON.stringify({ colorsEnabled: finalOptions.colorsEnabled }),
  ]

  return exec(...args, join('test', 'features', fileName))
}

// TODO: remove
export const args = [
  '--format',
  join(__dirname, '..', 'lib', 'src'),
  '--format-options',
  JSON.stringify({ colorsEnabled: false }),
]

// TODO: remove
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const exec = (...args: any[]): string => {
  args = [
    '--publish-quiet',
    '--require-module',
    'ts-node/register',
    '--require',
    join(__dirname, '..', 'lib', 'test'),
    ...args,
  ]
  console.log(`${cmd} ${args.join(' ')}`)

  let stdout: string
  try {<commit_msg>Deprecate helpers<commit_after>import { execFileSync } from 'child_process'
import { join } from 'path'

const cmd = 'node_modules/.bin/cucumber-js'

type RunOptionalOptions = {
  '--name'?: string
}
type RunOptions = {
  colorsEnabled?: boolean
}
type FinalRunOptions = RunOptionalOptions & Required<RunOptions>

export const run = (
  fileName: string,
  options: RunOptions & RunOptionalOptions = {}
): string => {
  const finalOptions: FinalRunOptions = { colorsEnabled: false, ...options }
  const args = [
    '--format',
    join(__dirname, '..', 'lib', 'src'),
    '--format-options',
    JSON.stringify({ colorsEnabled: finalOptions.colorsEnabled }),
  ]

  return exec(...args, join('test', 'features', fileName))
}

// TODO: remove
/** @deprecated */
export const args = [
  '--format',
  join(__dirname, '..', 'lib', 'src'),
  '--format-options',
  JSON.stringify({ colorsEnabled: false }),
]

// TODO: remove
// eslint-disable-next-line @typescript-eslint/no-explicit-any
/** @deprecated */
export const exec = (...args: any[]): string => {
  args = [
    '--publish-quiet',
    '--require-module',
    'ts-node/register',
    '--require',
    join(__dirname, '..', 'lib', 'test'),
    ...args,
  ]
  console.log(`${cmd} ${args.join(' ')}`)

  let stdout: string
  try {
{'fraction_non_alphanumeric': 0.19096671949286848, 'fraction_numerical': 0.0, 'mean_word_length': 3.414335664335664, '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': '1489998', 'n_tokens_mistral': 821, 'n_tokens_neox': 824, 'n_words': 185}