Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { addCommand } from "./index.js";
|
||||
|
||||
async function resolveValue<T>(value: T | (() => T) | (() => Promise<T>)): Promise<T> {
|
||||
if (typeof value === "function") {
|
||||
return await (value as () => T | Promise<T>)();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
describe("add command tree", () => {
|
||||
it("exposes hook / event-type / permission subcommands", async () => {
|
||||
const meta = await resolveValue(addCommand.meta);
|
||||
expect(meta).toMatchObject({ name: "add" });
|
||||
|
||||
const subs = await resolveValue(addCommand.subCommands);
|
||||
expect(Object.keys(subs ?? {}).sort()).toEqual(["event-type", "hook", "permission"]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user