Open developmentalmadness opened 8 years ago
In theory yes
But it's a hack and I would not recommend it
You could try to set modelInitValues before handling a command...
something like require('./myaggr').modelInitValues = {};
maybe I'm thinking of this in the wrong way. How would you recommend setting up aggregates for testing individual commands? Is there a reference sample somewhere I could look at? Or is the accepted method just handling an entire list of events for a given scenario?
I do it always, like the integrationTests: send a couple of commands...
Is there a way to manually set the state of an aggregate instance? Currently I am defining and handling all the commands it takes to put an aggregate instance in a specific state. Instead is there a way to just assume it correctly arrived at that state (like passing in a snapshot) and then handle the event?