Skip to content

[firebase_auth_web] Fix firebase auth test by wrapping Dart functions in js.allowInterop #1809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/firebase_auth/firebase_auth_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.1+3

* Fix the tests on dart2js.

## 0.1.1+2

* Update setup instructions in the README.
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_auth/firebase_auth_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: firebase_auth_web
description: The web implementation of firebase_auth
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_auth/firebase_auth_web
version: 0.1.1+2
version: 0.1.1+3

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ void main() {
js.context['firebase']['auth'] = js.allowInterop((dynamic app) {
return js.JsObject.jsify(
<String, dynamic>{
'signInAnonymously': () {
'signInAnonymously': js.allowInterop(() {
return _jsPromise(_fakeUserCredential());
},
}),
},
);
});
Expand All @@ -47,9 +47,9 @@ void main() {

js.JsObject _jsPromise(dynamic value) {
return js.JsObject.jsify(<String, dynamic>{
'then': (js.JsFunction f) {
f.apply(<dynamic>[value]);
},
'then': js.allowInterop((js.JsFunction resolve, js.JsFunction reject) {
resolve.apply(<dynamic>[value]);
}),
});
}

Expand Down