thenativeweb / cqrs-sample

CQRS, EventSourcing, (DDDD) Sample in node.js
148 stars 50 forks source link

Do you have suggestion on how to effectively unit tests the application of this sample? #28

Open alberto-coolshop opened 5 years ago

alberto-coolshop commented 5 years ago

I'm really interested in testing setup (with mocha) for a new CQRS project. Using this kind of approach I don't get where to start...

Do you have suggestions?

Many thanks, Alberto

adrai commented 5 years ago

You can test the domain like this: https://github.com/adrai/node-cqrs-domain/blob/master/test/integration/integrationTest.js cmd in -> event out (aggregateState etc...) and you can test denormalizer like this: https://github.com/adrai/node-cqrs-eventdenormalizer/blob/master/test/integration/integrationTest.js evt in -> notifications out