Replies: 1 comment
-
Related comment, seems this isn't planned for now: #1259 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, love the product, now migrating from v4 to v5.
I know you very much recommend event sourcing when you want to replicate being at the state of invoking an actor, alternatively using
getPersistedSnapshot
at that time and later restoring usingsnapshot
, but I have a use case which is very powerful in v4, and, as far as I can tell, it isn't possible in v5.In v4, I could do
and this would execute the invoked service/actor as well as any entry actions (provided
execute: true
), meaning I could test:Here's what the last one can look like:
On the other hand, if I want to do event sourcing, and my machine has many branches and long paths, I'm stuck either maintaining a plethora of event combinations to reconstruct all the transitions I'm interested in testing in isolation, and it woudn't really be in isolation because I would then be dependent upon the correct functionality of all the transitions happening before the one I actually want to test.
Alternative is an integration test per path, which quickly becomes unwieldy. Or, start using model based testing (which I want to do at some point, just not now in the middle of the migration).
I could start the machine at a previous state where a user-land event is accepted and use something like
actor.send("START")
to kick off a chain of reactions which will eventually invoke the service, but I sometimes have 4 or 5 services in sequence which depend on each other with guards determining the next invoked actor, meaning I have to then mock all of these to test the transition which only comes later.I guess my question is, is there any way to start a "restored" but un-started invoked actor/action/timer in v5, e.g.:
Actor repro: https://stackblitz.com/edit/github-wrjkuf-shs9hn?file=restoring.actor.test.ts
Timer repro: https://stackblitz.com/edit/github-wrjkuf-onryx6?file=restoring.timer.test.ts
Action repro: https://stackblitz.com/edit/github-wrjkuf-bufj8z?file=restoring.action.test.ts
Any advice?
Beta Was this translation helpful? Give feedback.
All reactions