Skip to content

Commit e565140

Browse files
committed
Document single-active-harness lifecycle constraint
1 parent 0a413c7 commit e565140

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/test-utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ export interface TestHarness {
4444
/**
4545
* Create a fresh test harness. Every test that needs isolation calls this.
4646
*
47+
* IMPORTANT: Do not call createTestHarness() twice without an intervening
48+
* teardown(). The second call captures the first's state, and teardown of the
49+
* second restores stale singletons. Use beforeEach/afterEach to guarantee a
50+
* single active harness per test.
51+
*
4752
* CRITICAL: ESM static imports resolve before any module body runs. This means
4853
* spawn/renderer.ts registers the production frame scheduler at import time,
4954
* and createTestHarness() (called in beforeEach) always wins because tests

0 commit comments

Comments
 (0)