mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-22 11:16:18 +08:00
[tests] initialise default app natively to work around Firebase Perf hard requirement on default app plist/json setup
This commit is contained in:
@@ -4,15 +4,15 @@ describe('App -> NativeModules -> Constants', () => {
|
||||
const { apps } = NativeModules.RNFBAppModule;
|
||||
|
||||
apps.should.be.an.Array();
|
||||
// secondaryFromNative
|
||||
apps.length.should.equal(1);
|
||||
// secondaryFromNative + default
|
||||
apps.length.should.equal(2);
|
||||
});
|
||||
|
||||
it('array items contain name, options & state properties', () => {
|
||||
const { apps } = NativeModules.RNFBAppModule;
|
||||
|
||||
apps.should.be.an.Array();
|
||||
apps.length.should.equal(1);
|
||||
apps.length.should.equal(2);
|
||||
|
||||
for (let i = 0; i < apps.length; i++) {
|
||||
const app = apps[i];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
describe('firebase', () => {
|
||||
it('it should allow creating the default app in JS', () => {
|
||||
it('it should allow read the default app from native', () => {
|
||||
// app is created in tests app before all hook
|
||||
should.equal(firebase.app()._nativeInitialized, false);
|
||||
should.equal(firebase.app()._nativeInitialized, true);
|
||||
should.equal(firebase.app().name, '[DEFAULT]');
|
||||
});
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppTheme">
|
||||
<provider
|
||||
android:name="com.google.firebase.provider.FirebaseInitProvider"
|
||||
android:authorities="${applicationId}.firebaseinitprovider"
|
||||
tools:node="remove"
|
||||
/>
|
||||
<!--<provider-->
|
||||
<!--android:name="com.google.firebase.provider.FirebaseInitProvider"-->
|
||||
<!--android:authorities="${applicationId}.firebaseinitprovider"-->
|
||||
<!--tools:node="remove"-->
|
||||
<!--/>-->
|
||||
|
||||
<!--<service-->
|
||||
<!--android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService"-->
|
||||
|
||||
@@ -4,8 +4,10 @@ const { detox: config } = require('../package.json');
|
||||
|
||||
const PACKAGES = [
|
||||
'app',
|
||||
'analytics',
|
||||
'iid',
|
||||
'perf',
|
||||
'functions',
|
||||
'analytics',
|
||||
// 'auth',
|
||||
// 'config',
|
||||
// 'crashlytics',
|
||||
@@ -22,7 +24,6 @@ for (let i = 0; i < PACKAGES.length; i++) {
|
||||
|
||||
before(async () => {
|
||||
await detox.init(config);
|
||||
await firebase.initializeApp(TestHelpers.core.config());
|
||||
});
|
||||
|
||||
beforeEach(async function beforeEach() {
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
//#import <RNFirebaseNotifications.h>
|
||||
//#import <RNFirebaseLinks.h>
|
||||
//@import GoogleSignIn;
|
||||
@import Firebase;
|
||||
|
||||
@implementation AppDelegate
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
[FIRApp configure];
|
||||
[FIRApp configureWithName:@"secondaryFromNative" options:[FIROptions defaultOptions]];
|
||||
// [GIDSignIn sharedInstance].clientID = [FIRApp defaultApp].options.clientID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user