Skip to content

[v0.41.0-alpha.3] Candidate 3: Consolidate the Test DOM Harness #109

Description

@SisyphusZheng

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions