fix(structures): widen via String() in narrowing test to satisfy lint #231

Merged
julien merged 1 commits from fix/structure-kind-spec-lint into main 2026-05-26 13:36:43 +02:00
@@ -35,7 +35,10 @@ describe('isStructureKind', () => {
}); });
it('narrows the type at the call site', () => { it('narrows the type at the call site', () => {
const candidate: string = 'medico_social'; // Round-trip through `String()` to widen the literal to `string`.
// Without this the inferred type is `'medico_social'`, already a
// StructureKind subtype — the narrowing check would be vacuous.
const candidate = String('medico_social');
if (!isStructureKind(candidate)) { if (!isStructureKind(candidate)) {
throw new Error('unreachable — candidate is a known kind'); throw new Error('unreachable — candidate is a known kind');
} }