|
25 | 25 | * silently disappeared; an exact list makes both directions a deliberate edit. |
26 | 26 | */ |
27 | 27 |
|
28 | | -import { describe, it, expect, beforeAll } from 'vitest'; |
| 28 | +import { describe, it, expect } from 'vitest'; |
29 | 29 | import { ComponentRegistry, PUBLIC_BLOCKS, type PublicComponentConfig } from '@object-ui/core'; |
| 30 | +// The two graphs whose registrations this file reads. At module scope, NOT |
| 31 | +// awaited inside a `beforeAll` — there their cold transform is billed to the |
| 32 | +// hook, against `hookTimeout`, which is why this needed a 60s budget. The import |
| 33 | +// phase has no test/hook timeout, so the raised timeout goes away rather than |
| 34 | +// getting raised again (objectui#3010). See AGENTS.md §9 (test discipline). |
| 35 | +// |
| 36 | +// Loading them here rather than in a hook does not change WHAT is loaded, so the |
| 37 | +// eager/lazy split the assertions below pin is untouched: static imports are |
| 38 | +// evaluated in order before the module body, and the shared setup still runs |
| 39 | +// before this module is imported at all. |
| 40 | +// |
| 41 | +// The layout/content primitives (Tier B) … |
| 42 | +import '@object-ui/components'; |
| 43 | +// … and the console's own plugin layer, from the module main.tsx boots from. |
| 44 | +import '../register-plugins'; |
30 | 45 |
|
31 | 46 | /** |
32 | 47 | * Every curated tag the console makes available, in `PUBLIC_BLOCKS` order. |
@@ -109,15 +124,11 @@ const EXPECTED_LAZY = [ |
109 | 124 | 'markdown', |
110 | 125 | ]; |
111 | 126 |
|
112 | | -let contract: Map<string, PublicComponentConfig>; |
113 | | - |
114 | | -beforeAll(async () => { |
115 | | - // The layout/content primitives (Tier B) … |
116 | | - await import('@object-ui/components'); |
117 | | - // … and the console's own plugin layer, from the module main.tsx boots from. |
118 | | - await import('../register-plugins'); |
119 | | - contract = new Map(ComponentRegistry.getPublicConfigs().map((c) => [c.type, c])); |
120 | | -}, 60000); |
| 127 | +// Safe at module scope: the two side-effect imports at the top of this file are |
| 128 | +// evaluated before the module body, so every registration is already in place. |
| 129 | +const contract: Map<string, PublicComponentConfig> = new Map( |
| 130 | + ComponentRegistry.getPublicConfigs().map((c) => [c.type, c]), |
| 131 | +); |
121 | 132 |
|
122 | 133 | describe('console ↔ PUBLIC_BLOCKS coverage', () => { |
123 | 134 | it('exposes every curated block the console ships, eager or lazy', () => { |
|
0 commit comments