eventric
Version:
Build JavaScript applications with Behaviour-driven Domain Design. Based on DDD, BDD, CQRS and EventSourcing.
21 lines (15 loc) • 723 B
text/coffeescript
describe 'Query Projection Feature', ->
describe 'given we created and initialized some example context including a queryhandler', ->
exampleContext = null
beforeEach (done) ->
exampleContext = eventric.context 'exampleContext'
exampleContext.addQueryHandler 'getExample', (params, callback) ->
@$projectionStore 'inmemory', 'ExampleProjection', (err, projectionStore) ->
callback null, projectionStore
exampleContext.initialize =>
done()
describe 'when we query the context', ->
it 'then the query should return the correct result', ->
exampleContext.query 'getExample', id: 1
.then (result) =>
expect(result).to.deep.equal {}