forked from NoeFabris/opencode-antigravity-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.test.ts
More file actions
26 lines (22 loc) · 930 Bytes
/
Copy pathschema.test.ts
File metadata and controls
26 lines (22 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
import { DEFAULT_CONFIG } from "./schema";
describe("cli_first config", () => {
it("includes cli_first default in DEFAULT_CONFIG", () => {
expect(DEFAULT_CONFIG).toHaveProperty("cli_first", false);
});
it("documents cli_first in the JSON schema", () => {
const schemaPath = new URL("../../../assets/antigravity.schema.json", import.meta.url);
const schema = JSON.parse(readFileSync(schemaPath, "utf8")) as {
properties?: Record<string, { type?: string; default?: unknown; description?: string }>;
};
const cliFirst = schema.properties?.cli_first;
expect(cliFirst).toBeDefined();
expect(cliFirst).toMatchObject({
type: "boolean",
default: false,
});
expect(typeof cliFirst?.description).toBe("string");
expect(cliFirst?.description?.length ?? 0).toBeGreaterThan(0);
});
});