feat: improve deployment workflows
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { db } from "../../command/db";
|
||||
import { exec } from "../../command/exec";
|
||||
|
||||
type RunnableCommand = {
|
||||
run?: (context: { args: { _: string[] } }) => Promise<unknown>;
|
||||
subCommands?: Record<string, RunnableCommand>;
|
||||
};
|
||||
|
||||
describe("CLI argument validation", () => {
|
||||
test("exec requires a deployment", async () => {
|
||||
await expect(
|
||||
(exec as RunnableCommand).run?.({ args: { _: [] } }),
|
||||
).rejects.toThrow("Deployment name is required");
|
||||
});
|
||||
|
||||
test("exec requires a command", async () => {
|
||||
await expect(
|
||||
(exec as RunnableCommand).run?.({ args: { _: ["app"] } }),
|
||||
).rejects.toThrow("Command is required");
|
||||
});
|
||||
|
||||
test("database credentials require a service", async () => {
|
||||
await expect(
|
||||
(db as RunnableCommand).subCommands?.creds?.run?.({ args: { _: [] } }),
|
||||
).rejects.toThrow("Service name is required");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user