recContents.docs = await this.renderContentList(ctx, userInfo._id, recContents.docs); ctx.helper.renderSuccess(ctx, { data: recContents recContents.docs = await renderContentList(ctx, userInfo._id, recContents.docs); sort: sortObj }) contents.docs = await this.renderContentList(ctx, userInfo._id, contents.docs);
describe('limit to last query', () => { const firestore = new Firestore(); const cities = ['San Francisco', 'Los Angeles', 'Tokyo', 'Beijing']; before(async () => { await Promise.all( cities.map(city => firestore.doc(`cities/${city}`).set({name: city})) ); }); after(async () => { const cityCollectionRef = firestore.collection('cities'); const cityDocs = ( await cityCollectionRef.select(FieldPath.documentId()).get() ).docs; await Promise.all( cityDocs.map(doc => cityCollectionRef.doc(doc.id).delete()) ); }); it('should run limitToLast query', () => { const output = exec('node limit-to-last-query.js'); assert.include(output, 'San Francisco'); assert.include(output, 'Tokyo'); }); });