Skip to content

Commit

Permalink
fix(tests, ios): resolve firebase-ios-sdk from app package.json
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mikehardy committed Feb 25, 2021
1 parent 904965b commit 680eb37
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
require 'json'
platform :ios, '10.0'
$RNFirebaseAsStaticFramework = false

# Version override - uncomment to test, otherwise take value from `@react-native-firebase/app`
#$FirebaseSDKVersion = '7.5.0'
appPackage = JSON.parse(File.read(File.join('..', '..', 'node_modules', '@react-native-firebase', 'app', 'package.json')))
$FirebaseSDKVersion = appPackage['sdkVersions']['ios']['firebase']

# Version override - uncomment to test overriding, otherwise take value from `@react-native-firebase/app`
# $FirebaseSDKVersion = '7.5.0'
Pod::UI.puts "react-native-firebase/tests: Using Firebase SDK version '#{$FirebaseSDKVersion}'"


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

0 comments on commit 680eb37

Please sign in to comment.