Firebase "Network error (for example, timeout, disconnected or inaccessible host)."

I am trying to write some tests for my database client, which requires me to authenticate with Firebase first.

I use Jest as my test runner.

My test is as follows:

it ('should sign in ', async (done) => {
  try {
    await auth.signInWithEmailAndPassword('testabc@test.com', 'testuser');
  } catch (e) {
    console.log(e);
  }
  done();
});

My firebase application was initialized and I confirmed the correctness of the API key.

A few interesting notes: even if I get:

'A network error (such as timeout, interrupted connection or unreachable host) has occurred.' 

On the firebase console, I see that my test user has logged in. Mirroring: Firebase throws "auth / network-request-failed" to signInAnonymously () while running jest tests

( / ), , .

.

?

+6
2

, / , .

: firebase.database.enableLogging(true);

, . , , Wireshark, , .

+1

. "platform/android/AndroidManifest.xml":

<uses-permission android:name="android.permission.INTERNET"/>     
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>    
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> 

--

config.xml

<allow-navigation href="*" /> 
0

Source: https://habr.com/ru/post/1694833/


All Articles