@bomb.sh/tools
Version:
The internal dev, build, and lint CLI for Bombshell projects
26 lines (24 loc) • 680 B
JavaScript
import { local } from "../utils.mjs";
import { x } from "tinyexec";
import { fileURLToPath } from "node:url";
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 Error("Could not resolve vitest.config file");
}
async function test(ctx) {
const stdio = x(local("vitest"), [
"run",
"--config",
resolveConfig(),
...ctx.args
]);
for await (const line of stdio) console.log(line);
}
//#endregion
export { test };
//# sourceMappingURL=test.mjs.map