()
| 24 | * adding a `*.stories.tsx` file puts it in the sidebar and under test together. |
| 25 | */ |
| 26 | export const loadStories = (): LoadedStory[] => { |
| 27 | const modules = import.meta.glob<StoryModule>("./*.stories.tsx", { |
| 28 | eager: true, |
| 29 | }); |
| 30 | |
| 31 | return Object.entries(modules).flatMap(([path, mod]) => { |
| 32 | const group = mod.title ?? path; |
| 33 | return Object.entries(mod).flatMap(([name, value]) => |
| 34 | isStory(value) ? [{ ...value, id: `${group}/${name}`, group, name }] : [], |
| 35 | ); |
| 36 | }); |
| 37 | }; |
no test coverage detected