autoheal
Version:
GPT Test driven development. Automatically fix tests and guide GPT to write and fix code using your tests.
22 lines (19 loc) • 436 B
text/typescript
import { execa } from "execa";
export async function runTests(testCommand: string) {
try {
//await $`npm test`; <-- test
await execa(testCommand, { shell: true });
return {
passes: true,
details: "",
rawDetails: "",
};
} catch (e: any) {
const rawDetails = String(e.stderr || e.stdout);
return {
passes: false,
details: rawDetails.slice(-2000),
rawDetails,
};
}
}