@@ -40,6 +40,7 @@ import { createTestComponent } from '../test/util';
40
40
import { Component , ComponentType } from '@firebase/component' ;
41
41
import { Logger } from '@firebase/logger' ;
42
42
import { FirebaseAppImpl } from './firebaseApp' ;
43
+ import { isBrowser } from '@firebase/util' ;
43
44
44
45
declare module '@firebase/component' {
45
46
interface NameServiceMapping {
@@ -184,6 +185,23 @@ describe('API tests', () => {
184
185
185
186
describe ( 'initializeServerApp' , ( ) => {
186
187
it ( 'creates FirebaseServerApp with options' , ( ) => {
188
+ if ( isBrowser ( ) ) {
189
+ const options = {
190
+ apiKey : 'APIKEY'
191
+ } ;
192
+ const serverAppSettings : FirebaseServerAppSettings = { } ;
193
+ expect ( ( ) => initializeServerApp ( options , serverAppSettings ) ) . throws (
194
+ / F i r e b a s e S e r v e r A p p i s n o t f o r u s e i n b r o w s e r e n v i r o n m e n t s ./
195
+ ) ;
196
+ }
197
+ } ) ;
198
+
199
+ it ( 'creates FirebaseServerApp with options' , ( ) => {
200
+ if ( isBrowser ( ) ) {
201
+ // FirebaseServerApp isn't supported for execution in browser enviornments.
202
+ return ;
203
+ }
204
+
187
205
const options = {
188
206
apiKey : 'APIKEY'
189
207
} ;
@@ -196,6 +214,11 @@ describe('API tests', () => {
196
214
} ) ;
197
215
198
216
it ( 'creates FirebaseServerApp with automaticDataCollectionEnabled' , ( ) => {
217
+ if ( isBrowser ( ) ) {
218
+ // FirebaseServerApp isn't supported for execution in browser enviornments.
219
+ return ;
220
+ }
221
+
199
222
const options = {
200
223
apiKey : 'APIKEY'
201
224
} ;
@@ -210,6 +233,11 @@ describe('API tests', () => {
210
233
} ) ;
211
234
212
235
it ( 'creates FirebaseServerApp with releaseOnDeref' , ( ) => {
236
+ if ( isBrowser ( ) ) {
237
+ // FirebaseServerApp isn't supported for execution in browser enviornments.
238
+ return ;
239
+ }
240
+
213
241
const options = { apiKey : 'APIKEY' } ;
214
242
const serverAppSettings : FirebaseServerAppSettings = {
215
243
automaticDataCollectionEnabled : false ,
@@ -222,6 +250,11 @@ describe('API tests', () => {
222
250
} ) ;
223
251
224
252
it ( 'creates FirebaseServerApp with FirebaseApp' , ( ) => {
253
+ if ( isBrowser ( ) ) {
254
+ // FirebaseServerApp isn't supported for execution in browser enviornments.
255
+ return ;
256
+ }
257
+
225
258
const options = {
226
259
apiKey : 'test1'
227
260
} ;
0 commit comments