Skip to content

Commit 680eb37

Browse files
committed
fix(tests, ios): resolve firebase-ios-sdk from app package.json
this was only working by coincidence prior, the variable was actually undefined, if for some reason the app/package.json firebase-ios-sdk was not in sync with what happened to be in firestore-ios-sdk-frameworks#master then it failed Override testing was performed, it still worked correctly when FirebaseSDKVersion is overridden
1 parent 904965b commit 680eb37

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/ios/Podfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
require 'json'
12
platform :ios, '10.0'
23
$RNFirebaseAsStaticFramework = false
34

4-
# Version override - uncomment to test, otherwise take value from `@react-native-firebase/app`
5-
#$FirebaseSDKVersion = '7.5.0'
5+
appPackage = JSON.parse(File.read(File.join('..', '..', 'node_modules', '@react-native-firebase', 'app', 'package.json')))
6+
$FirebaseSDKVersion = appPackage['sdkVersions']['ios']['firebase']
7+
8+
# Version override - uncomment to test overriding, otherwise take value from `@react-native-firebase/app`
9+
# $FirebaseSDKVersion = '7.5.0'
10+
Pod::UI.puts "react-native-firebase/tests: Using Firebase SDK version '#{$FirebaseSDKVersion}'"
11+
612

713
require_relative '../node_modules/react-native/scripts/react_native_pods'
814
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

0 commit comments

Comments
 (0)