Skip to content

Test Cases ​

🕙 Start time⌛ Duration
11/25/2026, 4:37:09 PM4.107 s
✅ Passed❌ Failed⏩ Skipped🚧 Todo⚪ Total
Test Suites90009
Tests2500025

4 passed, 0 failed, 0 skipped, 0 todo, done in 114.55690999999979 s

✅ react FSM routes
   ✅ shares a named instance across both hooks until its last subscriber unmounts
   ✅ warns and isolates colliding names, then releases the name for reuse
   ✅ gives a live machine priority over an alias matching its correlationId
   ✅ does not reserve a name during server rendering

7 passed, 0 failed, 0 skipped, 0 todo, done in 31.126717999999983 s

✅ store.ts (per-id stores)
   ✅ initializeFSM with instance returns correlationId and registers it
   ✅ initializeFSM with same instance twice returns same id and does not re-register
   ✅ getStore.getSnapshot throws when FSM not initialized for the id
   ✅ subscribe returns unsubscribe and changeState notifies only current id subscribers
   ✅ initializeFSM does not notify subscribers during init; notifications occur only on changeState
   ✅ multiple instances are isolated (changeState for one does not affect others)
   ✅ fsm_context.destroyFSM removes instance and store from registries

6 passed, 0 failed, 0 skipped, 0 todo, done in 48.98503800000003 s

✅ useFSM tests
   ✅ same instance reuses the same store
   ✅ exposes the class id while routing each instance by its correlationId
   ✅ change state after action
   ✅ trace previous context
   ✅ different instances have isolated automata
   ✅ does not re-render when dispatch results in the same state and context (isEqual guards)

8 passed, 0 failed, 0 skipped, 0 todo, done in 130.17311300000028 s

✅ useFSMWithSelector tests (selector-based hook)
   ✅ basic selector returns context
   ✅ selection reference is preserved when logically equal (isEqual preserves reference)
   ✅ without isEqual, selection reference changes even if logical value stays same
   ✅ constant primitive selection keeps the same value across transitions
   ✅ primitive boolean selection remains true for Red -> RedYellow
   ✅ selector: throws when selection returns null/undefined
✅ selective re-render with second counter
   ✅ selector: context.counter — Switch_1 after first Switch does not trigger re-render
   ✅ selector: context.counter2 — reacts only to Switch_1; Switch does not trigger re-render