reimagined / resolve

Full stack CQRS, DDD, Event Sourcing framework for Node.js
https://reimagined.github.io/resolve/
MIT License
773 stars 89 forks source link

read-model tester should have simple example and documentation. #1098

Closed krutilin closed 4 years ago

krutilin commented 5 years ago

At the moment it is quite difficult to figure out how to use read-model tester according to the examples in the repository. There should be a simple example like

here are your events const events = [...]

here is your adapter, which you should initialize each test

and here is your test, where projection and resolvers are from your app.

  test(`fermentables`, async () => {
    expect(
      await givenEvents(events)
        .readModel({
          name: 'Ingredients',
          projection,
          resolvers,
          adapter
        })
        .fermentables({})
    ).toMatchSnapshot(`fermentables`)
  })
MrCheater commented 4 years ago

Scheduled for release on May, 15