Skip to content

Commit

Permalink
chore(core): config test
Browse files Browse the repository at this point in the history
  • Loading branch information
pr-Mais committed Nov 23, 2021
1 parent 21e9d7e commit 64c776f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 62 deletions.

This file was deleted.

@@ -0,0 +1,35 @@
import 'dart:io';

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart';

class TestFirebaseConfig {
static FirebaseOptions get platformOptions {
if (kIsWeb) {
// Web
return const FirebaseOptions(
appId: '1:448618578101:web:0b650370bb29e29cac3efc',
apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0',
projectId: 'react-native-firebase-testing',
messagingSenderId: '448618578101',
);
} else if (Platform.isIOS || Platform.isMacOS) {
// iOS and MacOS
return const FirebaseOptions(
appId: '1:448618578101:ios:0b650370bb29e29cac3efc',
apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0',
projectId: 'react-native-firebase-testing',
messagingSenderId: '448618578101',
iosBundleId: 'io.flutter.plugins.firebasecoreexample',
);
} else {
// Android
return const FirebaseOptions(
appId: '1:448618578101:android:0446912d5f1476b6ac3efc',
apiKey: 'AIzaSyCuu4tbv9CwwTudNOweMNstzZHIDBhgJxA',
projectId: 'react-native-firebase-testing',
messagingSenderId: '448618578101',
);
}
}
}
Expand Up @@ -2,36 +2,19 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:flutter/foundation.dart' show kIsWeb;

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:drive/drive.dart' as drive;

import 'config.dart';

void main() => drive.main(testsMain);

void testsMain() {
String testAppName = 'TestApp';
FirebaseOptions? testAppOptions;

if (kIsWeb) {
testAppOptions = const FirebaseOptions(
appId: '1:448618578101:web:0b650370bb29e29cac3efc',
apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0',
projectId: 'react-native-firebase-testing',
messagingSenderId: '448618578101',
);
} else {
testAppOptions = const FirebaseOptions(
appId: '1:448618578101:ios:0b650370bb29e29cac3efc',
apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0',
projectId: 'react-native-firebase-testing',
messagingSenderId: '448618578101',
iosBundleId: 'io.flutter.plugins.firebasecoreexample',
);
}
FirebaseOptions? testAppOptions = TestFirebaseConfig.platformOptions;

setUpAll(() async {
await Firebase.initializeApp(name: testAppName, options: testAppOptions);
Expand Down

0 comments on commit 64c776f

Please sign in to comment.