File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -781,9 +781,20 @@ describe('remoteConfig()', function () {
781781 } ) ;
782782 } ) ;
783783
784- xdescribe ( 'onConfigUpdated' , function ( ) {
784+ describe ( 'onConfigUpdated on un-supported platforms' , function ( ) {
785+ it ( 'returns a descriptive error message if called' , async function ( ) {
786+ const { getRemoteConfig, onConfigUpdated } = remoteConfigModular ;
787+ try {
788+ onConfigUpdated ( getRemoteConfig ( ) ) ;
789+ } catch ( error ) {
790+ error . message . should . containEql ( 'Not supported by the Firebase Javascript SDK' ) ;
791+ }
792+ } ) ;
793+ } ) ;
794+
795+ xdescribe ( 'onConfigUpdated on supported platforms' , function ( ) {
785796 if ( Platform . other ) {
786- // Not supported on Web.
797+ // Not supported on Web, verify we get a nice error
787798 return ;
788799 }
789800
Original file line number Diff line number Diff line change 99 makeIDBAvailable ,
1010 setCustomSignals ,
1111} from '@react-native-firebase/app/lib/internal/web/firebaseRemoteConfig' ;
12- import { guard } from '@react-native-firebase/app/lib/internal/web/utils' ;
12+ import { guard , getWebError } from '@react-native-firebase/app/lib/internal/web/utils' ;
1313
1414let configSettingsForInstance = {
1515 // [APP_NAME]: RemoteConfigSettings
@@ -121,4 +121,7 @@ export default {
121121 return resultAndConstants ( remoteConfig , null ) ;
122122 } ) ;
123123 } ,
124+ onConfigUpdated ( ) {
125+ return getWebError ( 'unsupported' , 'Not supported by the Firebase Javascript SDK.' ) ;
126+ } ,
124127} ;
You can’t perform that action at this time.
0 commit comments