Skip to content

Commit

Permalink
feat(test): firebase mocks improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vheissu committed Dec 3, 2019
1 parent ae32593 commit 80220ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions __mocks__/firebase/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ const firebase: any = jest.genMockFromModule('firebase/app');
firebase.auth = jest.fn().mockImplementation(() => {
return {
currentUser: {
getIdToken: jest.fn().mockImplementation(() => '989duiu787u')
}
getIdToken: jest.fn().mockImplementation(() => '989duiu787u'),
getIdTokenResult: jest.fn().mockResolvedValue({ token: 'skdjfkfsdf3' })
},
onAuthStateChanged: jest.fn((callback) => {
callback({ uid: 'beggars' });
})
}
});

Expand Down

0 comments on commit 80220ae

Please sign in to comment.