Skip to content

Commit 1ac76b2

Browse files
Tyler Jonessquirly
authored andcommitted
Switch to flush in tests
1 parent 31253d8 commit 1ac76b2

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

test/unit/firestore.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,24 +187,25 @@ describe('MockFirestore', function () {
187187
});
188188
});
189189

190-
describe('getAll', function() {
191-
it('', function() {
190+
describe('#getAll', function() {
191+
it('gets the value of all passed documents', function() {
192192
var doc1 = db.doc('doc1');
193193
var doc2 = db.doc('doc2');
194194
var doc3 = db.doc('doc3');
195195

196-
db.autoFlush();
197-
198196
doc1.set({value: 1});
199197
doc2.set({value: 2});
200198

201-
return db
202-
.getAll(doc1, doc2, doc3)
203-
.then(function(snaps) {
204-
expect(snaps[0].data()).to.deep.equal({value: 1});
205-
expect(snaps[1].data()).to.deep.equal({value: 2});
206-
expect(snaps[2].exists).to.equal(false);
207-
});
199+
var getAll = db
200+
.getAll(doc1, doc2, doc3);
201+
202+
db.flush();
203+
204+
return getAll.then(function(snaps) {
205+
expect(snaps[0].data()).to.deep.equal({value: 1});
206+
expect(snaps[1].data()).to.deep.equal({value: 2});
207+
expect(snaps[2].exists).to.equal(false);
208+
});
208209
});
209210
});
210211
});

0 commit comments

Comments
 (0)