From architecture review improve-codebase-architecture. Deferred ponytail debt from alpha.2 bot reviews.
Problem
Fake DOM infrastructure (TestEvent, TestElement, TestShadowRoot, TestDocument, withMockDocument, flushRaf) is repeated across several large test files (binding-activation.test.ts, hydration-scope.test.ts, jsx-render-dom.test.ts, open-element.test.ts, components.test.ts). Subtle fake-DOM differences can hide browser-like bugs.
Solution
Create one internal test-support module (packages/core/__tests__/test-utils.ts already exists) that owns fake DOM construction, event dispatch, shadow root setup, and cleanup. Extract common classes and helpers.
Files/modules
packages/core/__tests__/test-utils.ts, binding-activation.test.ts, hydration-scope.test.ts, jsx-render-dom.test.ts, packages/element/__tests__/open-element.test.ts, packages/ui/__tests__/components.test.ts
Priority
Worth exploring — low complexity, high test-quality impact.
From architecture review
improve-codebase-architecture. Deferred ponytail debt from alpha.2 bot reviews.Problem
Fake DOM infrastructure (TestEvent, TestElement, TestShadowRoot, TestDocument, withMockDocument, flushRaf) is repeated across several large test files (
binding-activation.test.ts,hydration-scope.test.ts,jsx-render-dom.test.ts,open-element.test.ts,components.test.ts). Subtle fake-DOM differences can hide browser-like bugs.Solution
Create one internal test-support module (
packages/core/__tests__/test-utils.tsalready exists) that owns fake DOM construction, event dispatch, shadow root setup, and cleanup. Extract common classes and helpers.Files/modules
packages/core/__tests__/test-utils.ts,binding-activation.test.ts,hydration-scope.test.ts,jsx-render-dom.test.ts,packages/element/__tests__/open-element.test.ts,packages/ui/__tests__/components.test.tsPriority
Worth exploring — low complexity, high test-quality impact.