import { join } from "../../path/mod.ts";
type TestSuites = Record<string, string[]>;
interface Config { nodeVersion: string; ignore: TestSuites; tests: TestSuites; windowsIgnore: TestSuites; darwinIgnore: TestSuites; suitesFolder: string; versionsFolder: string;}
export const config: Config = JSON.parse( await Deno.readTextFile(new URL("./config.json", import.meta.url)),);
export const ignoreList = Object.entries(config.ignore).reduce( (total: RegExp[], [suite, paths]) => { paths.forEach((path) => total.push(new RegExp(join(suite, path)))); return total; }, [],);
export function getPathsFromTestSuites(suites: TestSuites): string[] { const testPaths: string[] = []; for (const [dir, paths] of Object.entries(suites)) { if (["parallel", "internet", "pummel", "sequential"].includes(dir)) { for (const path of paths) { testPaths.push(join(dir, path)); } } } return testPaths;}