suspense-fsm
v0.10.1
Published
Finite State Machine simulating React Suspense
Downloads
20
Maintainers
Readme
Testing
Main paths
Control Flow
- Start -> Spinning -> Ready
- Start -> Spinning -> Error
- Start -> Error
- Start -> Ready
Data Flow
- run operation (none | some) x timeout (any | default)
- ready (no data | data)
- error (no data | data)
Strategy
We will mix control and data flow in our test sequences.
Oracle
- Start -> Spinning -> Ready
- No run:
- emit timer | render fallback | render main
- run:
- run task | emit timer | render fallback | render main
- No run:
- Start -> Spinning -> Error
- No run:
- emit timer | render fallback | render error
- run:
- run task | emit timer | render fallback | render error
- No run:
- Start -> Ready
- No run:
- emit timer | render main
- run:
- run task | emit timer | render main
- No run:
- Start -> Error
- No run:
- emit timer | render main
- run:
- run task | emit timer | render main
- No run:
Properties
Abstracting null commands:
- emit timer is always there
- run task command is always before emit timer when present
- render main is last when present
- render error is last when present
- the render fallback command when present is always immediately after emit timer
Edge cases
Basically not starting with start, receiving unexpected events etc.
- make some myself: take the oracle and intersperse event there, I know where the null will be from the oracle
- make some random one