@@ -141,42 +141,36 @@ describe('Database@exp Tests', () => {
141
141
unsubscribe ( ) ;
142
142
} ) ;
143
143
144
- it ( 'can connect to emulator' , async ( ) => {
145
- if ( USE_EMULATOR ) {
144
+ if ( USE_EMULATOR ) {
145
+ it ( 'can connect to emulator' , async ( ) => {
146
146
const db = getDatabase ( defaultApp ) ;
147
147
connectDatabaseEmulator ( db , 'localhost' , parseInt ( EMULATOR_PORT , 10 ) ) ;
148
148
await get ( refFromURL ( db , `${ DATABASE_ADDRESS } /foo/bar` ) ) ;
149
- }
150
- } ) ;
151
- it ( 'can change emulator config before network operations' , async ( ) => {
152
- if ( USE_EMULATOR ) {
149
+ } ) ;
150
+ it ( 'can change emulator config before network operations' , async ( ) => {
153
151
const db = getDatabase ( defaultApp ) ;
154
152
const port = parseInt ( EMULATOR_PORT , 10 ) ;
155
153
connectDatabaseEmulator ( db , 'localhost' , port + 1 ) ;
156
154
connectDatabaseEmulator ( db , 'localhost' , port ) ;
157
155
await get ( refFromURL ( db , `${ DATABASE_ADDRESS } /foo/bar` ) ) ;
158
- }
159
- } ) ;
160
- it ( 'can connect to emulator after network operations with same parameters' , async ( ) => {
161
- if ( USE_EMULATOR ) {
156
+ } ) ;
157
+ it ( 'can connect to emulator after network operations with same parameters' , async ( ) => {
162
158
const db = getDatabase ( defaultApp ) ;
163
159
const port = parseInt ( EMULATOR_PORT , 10 ) ;
164
160
connectDatabaseEmulator ( db , 'localhost' , port ) ;
165
161
await get ( refFromURL ( db , `${ DATABASE_ADDRESS } /foo/bar` ) ) ;
166
162
connectDatabaseEmulator ( db , 'localhost' , port ) ;
167
- }
168
- } ) ;
169
- it ( 'cannot connect to emulator after network operations with different parameters' , async ( ) => {
170
- if ( USE_EMULATOR ) {
163
+ } ) ;
164
+ it ( 'cannot connect to emulator after network operations with different parameters' , async ( ) => {
171
165
const db = getDatabase ( defaultApp ) ;
172
166
const port = parseInt ( EMULATOR_PORT , 10 ) ;
173
167
connectDatabaseEmulator ( db , 'localhost' , port ) ;
174
168
await get ( refFromURL ( db , `${ DATABASE_ADDRESS } /foo/bar` ) ) ;
175
169
expect ( ( ) => {
176
170
connectDatabaseEmulator ( db , 'localhost' , 9001 ) ;
177
171
} ) . to . throw ( ) ;
178
- }
179
- } ) ;
172
+ } ) ;
173
+ }
180
174
181
175
it ( 'can properly handle unknown deep merges' , async ( ) => {
182
176
// Note: This test requires `testIndex` to be added as an index.
0 commit comments