API
defineConfig(config)
Section titled “defineConfig(config)”Typed helper for suitener.config.ts.
import { defineConfig } from "suitener-core";
export default defineConfig({ target: "./src"});loadConfig(root)
Section titled “loadConfig(root)”Loads and resolves suitener.config.ts from a root directory.
const config = await loadConfig(process.cwd());Returns:
interface ResolvedSuitenerConfig { root: string; target: string; include: string[]; exclude: string[];}introspect(target)
Section titled “introspect(target)”Scans a target project and returns a ProjectIntrospection object.
const project = await introspect("./path/to/backend");runTests(project)
Section titled “runTests(project)”Runs the detected test command for an introspected project.
const project = await introspect("./path/to/backend");const result = await runTests(project);If no test command or no test files exist, runTests delegates to generateStubs(project).
generateStubs(project)
Section titled “generateStubs(project)”Writes minimal Bun test stubs and returns a generated-mode result.
const project = await introspect("./path/to/backend");const result = await generateStubs(project);writeResults(project, result)
Section titled “writeResults(project, result)”Writes a run file and latest.json.
await writeResults(project, result);wrap(command, options)
Section titled “wrap(command, options)”Runs a Suitener check, then launches a child command.
const handle = await wrap("bun run dev", { cwd: process.cwd(), onTestComplete(result) { console.log(result.summary); }});
const exitCode = await handle.exited;Return shape:
interface WrapHandle { child: Bun.Subprocess; testRun: Promise<SuitenerResult>; exited: Promise<number>;}