@@ -23,7 +23,8 @@ const through = require('through2');
2323const googleProtoFiles = require ( 'google-proto-files' ) ;
2424const protobufjs = require ( 'protobufjs' ) ;
2525const duplexify = require ( 'duplexify' ) ;
26- const grpc = require ( 'google-gax' ) . grpc ( ) . grpc ;
26+ const gax = require ( 'google-gax' ) ;
27+ const grpc = new gax . GrpcClient ( ) . grpc ;
2728
2829const Firestore = require ( '../' ) ;
2930const reference = require ( '../src/reference' ) ( Firestore ) ;
@@ -297,7 +298,7 @@ function runTest(spec) {
297298 console . log ( `Running Spec:\n${ JSON . stringify ( spec , null , 2 ) } \n` ) ; // eslint-disable-line no-console
298299
299300 const updateTest = function ( spec ) {
300- firestore . _firestoreClient . _commit = commitHandler ( spec ) ;
301+ firestore . _firestoreClient . _innerApiCalls . commit = commitHandler ( spec ) ;
301302
302303 return Promise . resolve ( ) . then ( ( ) => {
303304 let varargs = [ ] ;
@@ -323,7 +324,7 @@ function runTest(spec) {
323324 } ;
324325
325326 const queryTest = function ( spec ) {
326- firestore . _firestoreClient . _runQuery = queryHandler ( spec ) ;
327+ firestore . _firestoreClient . _innerApiCalls . runQuery = queryHandler ( spec ) ;
327328
328329 const applyClause = function ( query , clause ) {
329330 if ( clause . select ) {
@@ -372,7 +373,7 @@ function runTest(spec) {
372373 } ;
373374
374375 const deleteTest = function ( spec ) {
375- firestore . _firestoreClient . _commit = commitHandler ( spec ) ;
376+ firestore . _firestoreClient . _innerApiCalls . commit = commitHandler ( spec ) ;
376377
377378 return Promise . resolve ( ) . then ( ( ) => {
378379 if ( spec . precondition ) {
@@ -385,7 +386,7 @@ function runTest(spec) {
385386 } ;
386387
387388 const setTest = function ( spec ) {
388- firestore . _firestoreClient . _commit = commitHandler ( spec ) ;
389+ firestore . _firestoreClient . _innerApiCalls . commit = commitHandler ( spec ) ;
389390
390391 return Promise . resolve ( ) . then ( ( ) => {
391392 const setOption = { } ;
@@ -407,7 +408,7 @@ function runTest(spec) {
407408 } ;
408409
409410 const createTest = function ( spec ) {
410- firestore . _firestoreClient . _commit = commitHandler ( spec ) ;
411+ firestore . _firestoreClient . _innerApiCalls . commit = commitHandler ( spec ) ;
411412
412413 return Promise . resolve ( ) . then ( ( ) => {
413414 return docRef ( spec . docRefPath ) . create (
@@ -417,7 +418,9 @@ function runTest(spec) {
417418 } ;
418419
419420 const getTest = function ( spec ) {
420- firestore . _firestoreClient . _batchGetDocuments = getHandler ( spec ) ;
421+ firestore . _firestoreClient . _innerApiCalls . batchGetDocuments = getHandler (
422+ spec
423+ ) ;
421424
422425 return Promise . resolve ( ) . then ( ( ) => {
423426 return docRef ( spec . docRefPath ) . get ( ) ;
@@ -429,7 +432,7 @@ function runTest(spec) {
429432
430433 const writeStream = through . obj ( ) ;
431434
432- firestore . _firestoreClient . _listen = ( ) => {
435+ firestore . _firestoreClient . _innerApiCalls . listen = ( ) => {
433436 return duplexify . obj ( through . obj ( ) , writeStream ) ;
434437 } ;
435438
0 commit comments