[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overload getAll function to allow array destructuring #515

Merged
merged 8 commits into from
Jan 9, 2019
Prev Previous commit
Next Next commit
Fix Transaction.getAll() test expect conditions
  • Loading branch information
cxam committed Jan 9, 2019
commit 069b0cf360f7dbacb05d697da6198cfb209c8d1f
20 changes: 10 additions & 10 deletions dev/system-test/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1443,16 +1443,16 @@ describe('Transaction class', () => {
const ref2 = randomCol.doc('doc2');
return Promise.all([ref1.set({f: 'a', b: 'b'}), ref2.set({f: 'a', b: 'b'})])
.then(() => {
return firestore.runTransaction(updateFunction => {
return updateFunction.getAll(...[ref1, ref2], {fieldMask: ['f']})
.then(docs => {
expect(docs[0].data()).to.deep.equal({f: 'a'});
expect(docs[1].data()).to.deep.equal({f: 'a'});
});
});
})
.then(res => {
expect(res).to.equal(2);
return firestore
.runTransaction(updateFunction => {
return updateFunction
.getAll(...[ref1, ref2], {fieldMask: ['f']})
.then((docs) => docs);
})
.then(docs => {
expect(docs[0].data()).to.deep.equal({f: 'a'});
expect(docs[1].data()).to.deep.equal({f: 'a'});
});
});
});

Expand Down