Skip to content

test: clean up React trees before Vitest teardown - #105

Merged
PeterGuy326 merged 1 commit into
mainfrom
test/react-cleanup-same-repo
Sep 28, 2026
Merged

PeterGuy326 merged 1 commit into
mainfrom
test/react-cleanup-same-repo

Conversation

@PeterGuy326

Copy link
Copy Markdown
Contributor

Same-repository replacement for #84

Mirrors exact head dcfb0d2a5fc547a87afbdac5448f5ea2f35d845a from fork PR #84 so CodeQL can run on the candidate. Scope remains one setup-file fix: register afterEach(cleanup) for React Testing Library under Vitest globals-disabled mode.

No issue is closed by this PR.

Source PR: #84

@PeterGuy326 PeterGuy326 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head self-owned delivery review on dcfb0d2a5fc547a87afbdac5448f5ea2f35d845a (formal COMMENT because this same-repository replacement is authored by the authenticated account). The one-file afterEach(cleanup) fix matches Vitest globals-disabled + React 19 teardown semantics. Same-repository test, docker-build, dependency review, Scorecard, and CodeQL are now green. Independent approval is still required from Bindy-lbb; no issue should be closed by this replacement.

@PeterGuy326

Copy link
Copy Markdown
Contributor Author

@waterbro-8 Exact head dcfb0d2a5fc547a87afbdac5448f5ea2f35d845a is the same one-file fix from #84, now with same-repo CodeQL/test/docker-build green. Please submit formal APPROVE if the prior fork-only blocker is resolved.

@Bindy-lbb Bindy-lbb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal CODEOWNER APPROVE — exact head dcfb0d2a5fc547a87afbdac5448f5ea2f35d845a.

Independent CODEOWNER technical review performed against exact head dcfb0d2a5fc547a87afbdac5448f5ea2f35d845a:

  • Exact Head & Parity:
    • headRefOid == dcfb0d2a5fc547a87afbdac5448f5ea2f35d845a, matching fork PR #84 byte-for-byte.
    • Same-repository branch test/react-cleanup-same-repo replaces fork PR #84 to enable origin CodeQL analysis.
  • CI & Security Status:
    • All 6 checks SUCCESS: test, docker-build, Dependency review, OpenSSF Scorecard, and same-repo CodeQL / CodeQL (javascript-typescript). Mergeable.
  • Root Cause & Code Quality Audit:
    • In vitest.config.mts, globals are disabled by default (globals: false), which prevents @testing-library/react from automatically registering its lifecycle cleanup hook.
    • Adding explicit afterEach(cleanup) in vitestSetup.ts ensures all mounted React 19 test DOM trees are properly unmounted before JSDOM tears down the window object. This eliminates race conditions where lingering concurrent transitions attempt reconciliation against an already-disposed window.
    • Change is isolated to 1 file (vitestSetup.ts, +8 −1 lines) with zero production runtime surface.
  • Governance:
    • Confirmed closingIssuesReferences is empty ([]). This replacement does not auto-close Issue #51, preserving issue tracking for broader test suite stability.

Approving this exact SHA.

Bindy-lbb (CODEOWNER)

@PeterGuy326
PeterGuy326 merged commit c298143 into main Sep 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants