export async function loadTestFiles()

in src/loader.ts [58:84]


export async function loadTestFiles(options: CliArgs, args: string[]) {
  /**
   * Preload modules before running the tests
   */
  const modules = [].concat(options.require || []).filter(Boolean);
  for (const name of modules) {
    if (isDepInstalled(name)) {
      require(name);
    } else {
      throw new Error(`cannot find module '${name}'`);
    }
  }

  if (options.inline) {
    const source = await readStdin();
    loadInlineScript(source);
    return;
  }
  /**
   * Handle piped files by reading the STDIN
   * ex: ls example/suites/*.js | npx @elastic/synthetics
   */
  const files =
    args.length > 0 ? args : (await readStdin()).split('\n').filter(Boolean);
  const suites = await prepareSuites(files, options.pattern);
  requireSuites(suites);
}