thenativeweb / node-cqrs-domain

Node-cqrs-domain is a node.js module based on nodeEventStore that. It can be very useful as domain component if you work with (d)ddd, cqrs, eventdenormalizer, host, etc.
http://cqrs.js.org/pages/domain.html
MIT License
269 stars 57 forks source link

How to clear/init #144

Closed bikerp closed 5 years ago

bikerp commented 5 years ago

Hi, I'd like to test pre-conditions for various commands. Is there a possibility to clear the eventstore in tests? I tried to run domain.init() before each test but it seems that the events are not discarded. Thanks Pavel

adrai commented 5 years ago

create a new domain like here: https://github.com/adrai/node-cqrs-domain/blob/master/test/integration/integrationTest.js or try to call domain.eventStore.store.clear()

bikerp commented 5 years ago

@adrai Yes, the domain.eventStore.store.clear() did the trick. Thanks