-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manually build aggregate state for unit testing #79
Comments
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?
The text was updated successfully, but these errors were encountered: