Commit 48a5f56
fix(tests): make useStoreRehydrated suspense test deterministic (#1032)
The test relied on a setTimeout-based async memory storage (18ms wait)
to keep the rehydration promise pending while asserting the Suspense
fallback. Under coverage instrumentation in CI the timer could fire
inside the surrounding act() block, so React unsuspended before the
Loading assertion ran.
Switches to a manually-controlled deferred promise so the rehydration
gate is held until the test explicitly releases it.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fa8912d commit 48a5f56
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
936 | | - | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
937 | 945 | | |
938 | 946 | | |
939 | 947 | | |
| |||
966 | 974 | | |
967 | 975 | | |
968 | 976 | | |
| 977 | + | |
969 | 978 | | |
970 | 979 | | |
971 | 980 | | |
| |||
0 commit comments