{"version":3,"file":"test.mjs","names":[],"sources":["../../src/commands/test.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { x } from 'tinyexec';\nimport type { CommandContext } from '../context.ts';\nimport { local, ToolsError } from '../utils.ts';\n\nfunction resolveConfig(): string {\n\t// Built output (.mjs) or source (.ts)\n\tfor (const ext of ['.mjs', '.ts']) {\n\t\tconst url = new URL(`../test-utils/vitest.config${ext}`, import.meta.url);\n\t\tconst path = fileURLToPath(url);\n\t\tif (existsSync(path)) return path;\n\t}\n\tthrow new ToolsError('Could not resolve vitest.config file', 'VITEST_CONFIG_NOT_FOUND');\n}\n\nexport async function test(ctx: CommandContext) {\n\tconst stdio = x(local('vitest'), ['run', '--config', resolveConfig(), ...ctx.args]);\n\n\tfor await (const line of stdio) {\n\t\tconsole.info(line);\n\t}\n}\n"],"mappings":";;;;;AAMA,SAAS,gBAAwB;CAEhC,KAAK,MAAM,OAAO,CAAC,QAAQ,KAAK,GAAG;EAElC,MAAM,OAAO,cAAc,IADX,IAAI,8BAA8B,OAAO,OAAO,KAAK,GACxC,CAAC;EAC9B,IAAI,WAAW,IAAI,GAAG,OAAO;CAC9B;CACA,MAAM,IAAI,WAAW,wCAAwC,yBAAyB;AACvF;AAEA,eAAsB,KAAK,KAAqB;CAC/C,MAAM,QAAQ,EAAE,MAAM,QAAQ,GAAG;EAAC;EAAO;EAAY,cAAc;EAAG,GAAG,IAAI;CAAI,CAAC;CAElF,WAAW,MAAM,QAAQ,OACxB,QAAQ,KAAK,IAAI;AAEnB"}