UNPKG

@bomb.sh/tools

Version:

The internal dev, build, and lint CLI for Bombshell projects

25 lines (24 loc) 724 B
import { ToolsError, local } from "../utils.mjs"; import { fileURLToPath } from "node:url"; import { x } from "tinyexec"; import { existsSync } from "node:fs"; //#region src/commands/test.ts function resolveConfig() { for (const ext of [".mjs", ".ts"]) { const path = fileURLToPath(new URL(`../test-utils/vitest.config${ext}`, import.meta.url)); if (existsSync(path)) return path; } throw new ToolsError("Could not resolve vitest.config file", "VITEST_CONFIG_NOT_FOUND"); } async function test(ctx) { const stdio = x(local("vitest"), [ "run", "--config", resolveConfig(), ...ctx.args ]); for await (const line of stdio) console.info(line); } //#endregion export { test }; //# sourceMappingURL=test.mjs.map