Repository navigation
test: clean up React trees before Vitest teardown - #105
Conversation
PeterGuy326
left a comment
There was a problem hiding this comment.
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.
|
@waterbro-8 Exact head |
Bindy-lbb
left a comment
There was a problem hiding this comment.
Formal CODEOWNER APPROVE — exact head dcfb0d2a5fc547a87afbdac5448f5ea2f35d845a.
Independent CODEOWNER technical review performed against exact head dcfb0d2a5fc547a87afbdac5448f5ea2f35d845a:
- Exact Head & Parity:
- CI & Security Status:
- All 6 checks SUCCESS:
test,docker-build,Dependency review,OpenSSF Scorecard, and same-repoCodeQL/CodeQL (javascript-typescript). Mergeable.
- All 6 checks SUCCESS:
- Root Cause & Code Quality Audit:
- In
vitest.config.mts, globals are disabled by default (globals: false), which prevents@testing-library/reactfrom automatically registering its lifecycle cleanup hook. - Adding explicit
afterEach(cleanup)invitestSetup.tsensures 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.
- In
- Governance:
- Confirmed
closingIssuesReferencesis empty ([]). This replacement does not auto-close Issue #51, preserving issue tracking for broader test suite stability.
- Confirmed
Approving this exact SHA.
Bindy-lbb (CODEOWNER)
Same-repository replacement for #84
Mirrors exact head
dcfb0d2a5fc547a87afbdac5448f5ea2f35d845afrom fork PR #84 so CodeQL can run on the candidate. Scope remains one setup-file fix: registerafterEach(cleanup)for React Testing Library under Vitest globals-disabled mode.No issue is closed by this PR.
Source PR: #84