File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/database-compat/test Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -272,18 +272,27 @@ describe('Database Tests', () => {
272
272
} ) ;
273
273
274
274
it ( 'refFromURL() validates argument' , ( ) => {
275
+ // TODO: Remove all any references
275
276
const db = ( firebase as any ) . database ( ) ;
276
277
expect ( ( ) => {
277
278
const ref = ( db as any ) . refFromURL ( ) ;
278
279
} ) . to . throw ( / E x p e c t s a t l e a s t 1 / ) ;
279
280
} ) ;
280
281
281
282
it ( 'can call useEmulator before use' , ( ) => {
282
- const db = ( firebase as any ) . database ( ) ;
283
+ const db = firebase . database ( ) ;
284
+ // Cast as any as _delegate isn't a public property
283
285
db . useEmulator ( 'localhost' , 1234 ) ;
286
+ // Cast as any as _delegate isn't a public property
287
+ expect ( ( db as any ) . _delegate . _repo . repoInfo_ . isUsingEmulator ) . to . be . true ;
284
288
expect ( db . ref ( ) . toString ( ) ) . to . equal ( 'http://localhost:1234/' ) ;
285
289
} ) ;
286
290
291
+ it ( 'initializes usingEmulator to false before use' , ( ) => {
292
+ const db = firebase . database ( ) ;
293
+ expect ( ( db as any ) . _delegate . _repo . repoInfo_ . isUsingEmulator ) . to . be . false ;
294
+ } ) ;
295
+
287
296
it ( 'cannot call useEmulator after use' , ( ) => {
288
297
const db = ( firebase as any ) . database ( ) ;
289
298
You can’t perform that action at this time.
0 commit comments