Skip to content
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

Add tests for _initAuthResolver in FirebaseAuth #950

Closed

Conversation

PezCoder
Copy link

@PezCoder PezCoder commented Aug 19, 2017

Description

src/auth/FirebaseAuth.js contains a function named _initAuthResolver
This pr adds unit test cases for _initAuthResolver function.
Reference: #951

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.852% when pulling b346d24 on PezCoder:tests/_initAuthResolver into b6dca6e on firebase:master.

@PezCoder
Copy link
Author

PezCoder commented Aug 22, 2017

Not sure why the travis is breaking,
My observations for the second test:

  1. ctx._initAuthResolver() will invoke auth.onAuthStateChanged internally with a callback to resolve the promise returned by _initAuthResolver function
  2. Also our spy should be triggered & fakePromiseResolve should now contain a function calling which should call the above callback
  3. Calling fakePromiseResolve & Promise should be resolved & expect should be checked, done should let the jasmine know that the task is done.

It's running fine locally but not on travis, maybe it's not resolving on travis.
Am I missing something ? 🤔

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.852% when pulling 7ab47ed on PezCoder:tests/_initAuthResolver into b6dca6e on firebase:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.852% when pulling de454f7 on PezCoder:tests/_initAuthResolver into b6dca6e on firebase:master.

@PezCoder
Copy link
Author

The newly added tests are passing as expected now, after i added tick() method at last. 😄
Buy how ? Also other tests that are not related to my pr are breaking.

@PezCoder PezCoder closed this Nov 21, 2017
@PezCoder PezCoder deleted the tests/_initAuthResolver branch November 21, 2017 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants