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