Skip to content

Commit

Permalink
fix latest instance for firebase local
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Dec 13, 2024
1 parent b554a02 commit f72791b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion firebase_local/lib/src/firebase_local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FirebaseLocal with FirebaseMixin {
options ??= AppOptions(projectId: _defaultProjectId);

var app = AppLocal(this, options, name);
_apps[name] = app;
_apps[name] = FirebaseMixin.latestFirebaseInstanceOrNull = app;
return app;
}

Expand Down
7 changes: 7 additions & 0 deletions firebase_local/test/firebase_local_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
library;

import 'package:tekartik_firebase/firebase_mixin.dart';
import 'package:tekartik_firebase_local/firebase_local.dart';
import 'package:tekartik_firebase_test/firebase_test.dart';
import 'package:test/test.dart';
Expand All @@ -13,6 +14,12 @@ void main() {
var firebase = FirebaseLocal();
expect(firebase.isLocal, isTrue);
});
test('initialize sync and latest', () {
FirebaseMixin.latestFirebaseInstanceOrNull = null;
var firebase = FirebaseLocal();
var app = firebase.initializeApp(options: AppOptions(projectId: 'test'));
expect(FirebaseMixin.latestFirebaseInstanceOrNull, app);
});
test('projectId', () async {
var firebase = FirebaseLocal();
var app = await firebase.initializeAppAsync(
Expand Down

0 comments on commit f72791b

Please sign in to comment.