@@ -35,6 +35,7 @@ import {
3535 orderByKey
3636} from '../../src/api/Reference_impl' ;
3737import {
38+ connectDatabaseEmulator ,
3839 getDatabase ,
3940 goOffline ,
4041 goOnline ,
@@ -46,8 +47,10 @@ import { EventAccumulatorFactory } from '../helpers/EventAccumulator';
4647import {
4748 DATABASE_ADDRESS ,
4849 DATABASE_URL ,
50+ EMULATOR_PORT ,
4951 getFreshRepo ,
5052 getRWRefs ,
53+ USE_EMULATOR ,
5154 waitFor ,
5255 waitUntil ,
5356 writeAndValidate
@@ -138,15 +141,15 @@ describe('Database@exp Tests', () => {
138141 unsubscribe ( ) ;
139142 } ) ;
140143
141- /* it('can connected to emulator', async () => {
142- if (isEmulatorActive() ) {
144+ it ( 'can connected to emulator' , async ( ) => {
145+ if ( USE_EMULATOR ) {
143146 const db = getDatabase ( defaultApp ) ;
144147 connectDatabaseEmulator ( db , 'localhost' , parseInt ( EMULATOR_PORT , 10 ) ) ;
145148 await get ( refFromURL ( db , `${ DATABASE_ADDRESS } /foo/bar` ) ) ;
146149 }
147150 } ) ;
148151 it ( 'can chnage emulator config before network operations' , async ( ) => {
149- if (isEmulatorActive() ) {
152+ if ( USE_EMULATOR ) {
150153 const db = getDatabase ( defaultApp ) ;
151154 const port = parseInt ( EMULATOR_PORT , 10 ) ;
152155 connectDatabaseEmulator ( db , 'localhost' , port + 1 ) ;
@@ -155,7 +158,7 @@ describe('Database@exp Tests', () => {
155158 }
156159 } ) ;
157160 it ( 'can connected to emulator after network operations with same parameters' , async ( ) => {
158- if (isEmulatorActive() ) {
161+ if ( USE_EMULATOR ) {
159162 const db = getDatabase ( defaultApp ) ;
160163 const port = parseInt ( EMULATOR_PORT , 10 ) ;
161164 connectDatabaseEmulator ( db , 'localhost' , port ) ;
@@ -164,7 +167,7 @@ describe('Database@exp Tests', () => {
164167 }
165168 } ) ;
166169 it ( 'cannot connect to emulator after network operations with different parameters' , async ( ) => {
167- if (isEmulatorActive() ) {
170+ if ( USE_EMULATOR ) {
168171 const db = getDatabase ( defaultApp ) ;
169172 const port = parseInt ( EMULATOR_PORT , 10 ) ;
170173 connectDatabaseEmulator ( db , 'localhost' , port ) ;
@@ -174,7 +177,6 @@ describe('Database@exp Tests', () => {
174177 } ) . to . throw ( ) ;
175178 }
176179 } ) ;
177- */
178180
179181 it ( 'can properly handle unknown deep merges' , async ( ) => {
180182 // Note: This test requires `testIndex` to be added as an index.
0 commit comments