MCPcopy Create free account
hub / github.com/anus-dev/ANUS / checkBooleanDefaults

Function checkBooleanDefaults

packages/cli/src/config/settingsSchema.test.ts:160–177  ·  view source on GitHub ↗
(schema: Record<string, unknown>)

Source from the content-addressed store, hash-verified

158
159 it('should have consistent default values for boolean settings', () => {
160 const checkBooleanDefaults = (schema: Record<string, unknown>) => {
161 Object.entries(schema).forEach(
162 ([_key, definition]: [string, unknown]) => {
163 const def = definition as {
164 type?: string;
165 default?: unknown;
166 properties?: Record<string, unknown>;
167 };
168 if (def.type === 'boolean') {
169 // Boolean settings can have boolean or undefined defaults (for optional settings)
170 expect(['boolean', 'undefined']).toContain(typeof def.default);
171 }
172 if (def.properties) {
173 checkBooleanDefaults(def.properties);
174 }
175 },
176 );
177 };
178
179 checkBooleanDefaults(SETTINGS_SCHEMA as Record<string, unknown>);
180 });

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected