How to map an xstate-test event that is meant to be "emitted internally" #1590
Unanswered
CMCDragonkai
asked this question in
Q&A
Replies: 1 comment 2 replies
-
After thinking about this a bit more. It seems xstate-test was designed to test transitions and states that are observable by something external to the service/implementation. If the model we have is modelling internal transitions and states that are not observable by external parties, then xstate-test cannot know how to generate paths for them nor know when to actually run the test assertions. This makes it bit tricky to use on models that were designed to explain how a system implementation internally works. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an event in a state machine that isn't meant to be triggered from outside of the state machine. This event is triggered upon completion of some asynchronous process inside the state machine.
So the state machine goes into a state called
backingUp
. This process can involve some time. When it completes, aBACKUP_FINISH
event/transition occurs which means the state machines goes to another state.In xstate test, we have something like:
There are no calls that we need to do here. Once in the
backingUp
state, the process runs and completes, it will automatically transition to the next state.Our original way of doing this was to add some sort of monitor, so that way the
exec
handler just blocks until thebackingUp
completes. Is this correct?Beta Was this translation helpful? Give feedback.
All reactions