(schema: Record<string, unknown>)
| 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 | }); |
no outgoing calls
no test coverage detected