File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 22
33var _ = require ( './lodash' ) ;
44var assert = require ( 'assert' ) ;
5+ var Stream = require ( 'stream' ) ;
56var Promise = require ( 'rsvp' ) . Promise ;
67var autoId = require ( 'firebase-auto-ids' ) ;
78var QuerySnapshot = require ( './firestore-query-snapshot' ) ;
@@ -108,6 +109,19 @@ MockFirestoreQuery.prototype.get = function () {
108109 } ) ;
109110} ;
110111
112+ MockFirestoreQuery . prototype . stream = function ( ) {
113+ var stream = new Stream ( ) ;
114+
115+ this . get ( ) . then ( function ( snapshots ) {
116+ snapshots . forEach ( function ( snapshot ) {
117+ stream . emit ( 'data' , snapshot ) ;
118+ } ) ;
119+ stream . emit ( 'end' ) ;
120+ } ) ;
121+
122+ return stream ;
123+ } ;
124+
111125MockFirestoreQuery . prototype . where = function ( property , operator , value ) {
112126 var query ;
113127
You can’t perform that action at this time.
0 commit comments