@@ -7,6 +7,7 @@ import { Request, Response } from 'express';
77export * from './pubsub-tests' ;
88export * from './database-tests' ;
99export * from './auth-tests' ;
10+ export * from './firestore-tests' ;
1011const numTests = Object . keys ( exports ) . length ; // Assumption: every exported function is its own test.
1112
1213firebase . initializeApp ( _ . omit ( functions . config ( ) . firebase , 'credential' ) ) ; // Explicitly decline admin privileges.
@@ -16,7 +17,6 @@ export const integrationTests: any = functions.https.onRequest((req: Request, re
1617 let pubsub : any = require ( '@google-cloud/pubsub' ) ( ) ;
1718
1819 const testId = firebase . database ( ) . ref ( ) . push ( ) . key ;
19-
2020 return Promise . all ( [
2121 // A database write to trigger the Firebase Realtime Database tests.
2222 // The database write happens without admin privileges, so that the triggered function's "event.data.ref" also
@@ -33,6 +33,8 @@ export const integrationTests: any = functions.https.onRequest((req: Request, re
3333 // A user deletion to trigger the Firebase Auth user deletion tests.
3434 admin . auth ( ) . deleteUser ( userRecord . uid ) ;
3535 } ) ,
36+ // A firestore write to trigger the Cloud Firestore tests.
37+ admin . firestore ( ) . collection ( 'tests' ) . doc ( testId ) . set ( { test : testId } ) ,
3638 ] ) . then ( ( ) => {
3739 // On test completion, check that all tests pass and reply "PASS", or provide further details.
3840 console . log ( 'Waiting for all tests to report they pass...' ) ;
0 commit comments