Skip to content

Commit f140c49

Browse files
committed
add tests for streamEventsByRevision
1 parent a01d9dc commit f140c49

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/eventstoreTest.js

+21-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ describe('eventstore', function () {
2828
expect(es).to.be.a('object');
2929
expect(es.useEventPublisher).to.be.a('function');
3030
expect(es.init).to.be.a('function');
31+
expect(es.streamEvents).to.be.a('function');
32+
expect(es.streamEventsSince).to.be.a('function');
33+
expect(es.streamEventsByRevision).to.be.a('function');
3134
expect(es.getEvents).to.be.a('function');
3235
expect(es.getEventsSince).to.be.a('function');
3336
expect(es.getEventsByRevision).to.be.a('function');
@@ -1544,7 +1547,7 @@ describe('eventstore', function () {
15441547
});
15451548
});
15461549

1547-
describe('requesting existing events since a date and using next function', function () {
1550+
describe('requesting existing events since a date', function () {
15481551
describe('and committing some new events', function () {
15491552
it('it should work as expected', function (done) {
15501553
var evts = [];
@@ -1559,6 +1562,23 @@ describe('eventstore', function () {
15591562
});
15601563
});
15611564
});
1565+
describe('requesting existing events by revision', function () {
1566+
describe('and committing some new events', function () {
1567+
it('it should work as expected', function (done) {
1568+
var evts = [];
1569+
var stream = es.streamEventsByRevision('myAggId2', 0, 3);
1570+
stream.on('data', function (e) {
1571+
console.log('mitkot');
1572+
evts.push(e);
1573+
});
1574+
stream.on('end', function(){
1575+
expect(evts.length).to.eql(3);
1576+
done();
1577+
});
1578+
});
1579+
});
1580+
});
1581+
15621582
});
15631583
}
15641584

0 commit comments

Comments
 (0)