mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-29 12:45:45 +08:00
[tests][auth] ensure signed out state before each auth test
This commit is contained in:
@@ -2,7 +2,7 @@ describe('auth()', () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
if (firebase.auth().currentUser) {
|
if (firebase.auth().currentUser) {
|
||||||
await firebase.auth().signOut();
|
await firebase.auth().signOut();
|
||||||
await sleep(25);
|
await sleep(50);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
describe('auth() -> emailLink Provider', () => {
|
describe('auth() -> emailLink Provider', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
if (firebase.auth().currentUser) {
|
||||||
|
await firebase.auth().signOut();
|
||||||
|
await sleep(50);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
describe('sendSignInLinkToEmail', () => {
|
describe('sendSignInLinkToEmail', () => {
|
||||||
it('should send email', async () => {
|
it('should send email', async () => {
|
||||||
const random = randomString(12, '#aA');
|
const random = randomString(12, '#aA');
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
describe('auth() -> Providers', () => {
|
describe('auth() -> Providers', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
if (firebase.auth().currentUser) {
|
||||||
|
await firebase.auth().signOut();
|
||||||
|
await sleep(50);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
describe('EmailAuthProvider', () => {
|
describe('EmailAuthProvider', () => {
|
||||||
describe('constructor', () => {
|
describe('constructor', () => {
|
||||||
it('should throw an unsupported error', () => {
|
it('should throw an unsupported error', () => {
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
describe('auth().currentUser', () => {
|
describe('auth().currentUser', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
if (firebase.auth().currentUser) {
|
||||||
|
await firebase.auth().signOut();
|
||||||
|
await sleep(50);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
describe('getIdToken()', () => {
|
describe('getIdToken()', () => {
|
||||||
it('should return a token', async () => {
|
it('should return a token', async () => {
|
||||||
const random = randomString(12, '#aA');
|
const random = randomString(12, '#aA');
|
||||||
|
|||||||
Reference in New Issue
Block a user