From d640da32cb47e5a4c80da876fd6437a5eaa89c96 Mon Sep 17 00:00:00 2001 From: vince Date: Sat, 20 Jun 2026 07:40:52 +0200 Subject: [PATCH] test(ui): assert public prop exports are detected --- src/storybook.test.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/storybook.test.ts b/src/storybook.test.ts index 9b73c69..9a18ecd 100644 --- a/src/storybook.test.ts +++ b/src/storybook.test.ts @@ -138,14 +138,20 @@ describe("Storybook inventory", () => { }); test("exports component prop interfaces through grouped package entrypoints", () => { + let propInterfaceCount = 0; + for (const component of componentInventory()) { const source = readFileSync(component.path, "utf8"); const propTypeName = `${component.name}Props`; + const propExportPattern = new RegExp( + `export\\s+(interface|type)\\s+${propTypeName}\\b`, + ); - if (!source.match(new RegExp(`export\\\\s+(interface|type)\\\\s+${propTypeName}\\\\b`))) { + if (!propExportPattern.test(source)) { continue; } + propInterfaceCount += 1; const domainIndexSource = readFileSync( join(componentsDir, component.domain, "index.ts"), "utf8", @@ -155,6 +161,8 @@ describe("Storybook inventory", () => { `export * from "./${component.name}";`, ); } + + expect(propInterfaceCount).toBeGreaterThan(0); }); test("keeps Storybook fixtures generic and content-free", () => {