@@ -64,7 +64,6 @@ import {
64
64
toChangesArray ,
65
65
toDataArray ,
66
66
PERSISTENCE_MODE_UNSPECIFIED ,
67
- withAlternateTestDb ,
68
67
withEmptyTestCollection ,
69
68
withRetry ,
70
69
withTestCollection ,
@@ -77,7 +76,7 @@ import { captureExistenceFilterMismatches } from '../util/testing_hooks_util';
77
76
apiDescribe ( 'Queries' , persistence => {
78
77
addEqualityMatcher ( ) ;
79
78
80
- it ( 'DDB4 local QuerySnapshot.toJSON bundle getDocFromCache' , async ( ) => {
79
+ it ( 'QuerySnapshot.toJSON bundle getDocFromCache' , async ( ) => {
81
80
let path : string | null = null ;
82
81
let jsonBundle : object | null = null ;
83
82
const testDocs = {
@@ -100,22 +99,21 @@ apiDescribe('Queries', persistence => {
100
99
} ) ;
101
100
} ) ;
102
101
expect ( jsonBundle ) . to . not . be . null ;
103
- console . log ( "DEDB json bundle: " , jsonBundle ) ;
104
102
// eslint-disable-next-line @typescript-eslint/no-explicit-any
105
103
const json = ( jsonBundle as any ) . bundle ;
106
104
expect ( json ) . to . exist ;
107
105
expect ( json . length ) . to . be . greaterThan ( 0 ) ;
108
- // Use a new instance to load the bundle to ensure that the cache is primed by the bundle and
109
- // not the previous getDocs call.
110
- await withTestDb ( persistence , async db => {
111
- await loadBundle ( db , json ) ;
112
- const docRef = doc ( db , path ! ) ;
113
- const docSnap = await getDocFromCache ( docRef ) ;
114
- expect ( docSnap . exists ) ;
115
- expect ( docSnap . data ( ) ) . to . deep . equal ( testDocs . a ) ;
116
- console . log ( "DEDB metadata.fromCache: " , docSnap . metadata . fromCache ) ;
117
- //expect(docSnap.metadata.fromCache).to.be.true ;
118
- } ) ;
106
+
107
+ if ( path !== null ) {
108
+ await withTestDb ( persistence , async db => {
109
+ const docRef = doc ( db , path ! ) ;
110
+ await loadBundle ( db , json ) ;
111
+
112
+ const docSnap = await getDocFromCache ( docRef ) ;
113
+ expect ( docSnap . exists ) ;
114
+ expect ( docSnap . data ( ) ) . to . deep . equal ( testDocs . a ) ;
115
+ } ) ;
116
+ }
119
117
} ) ;
120
118
121
119
it ( 'can issue limit queries' , ( ) => {
0 commit comments