Skip to content

Conversation

@hitochan777
Copy link
Contributor

Changes

  • initSessionService now returns promise
  • refreshFromLocalStorage also returns promise sessionService.loadUser().then(...) to guarantee that user is set to the redux state when the promise returned by initSessionService is resolved.
  • beforeAll in index.spec.js calls done when the promise is resolved, instead of subscribing to redux store.

@hitochan777
Copy link
Contributor Author

@bernabe9 I noticed that __setSession, __setUser and __setError modifies the global variables in localforage.js but you did not initialize them before each test. Maybe we should do so in order to make all the tests independent of the previous tests? Or did you do this intentionally for some reason? Thanks!

@coveralls
Copy link

coveralls commented Nov 3, 2017

Coverage Status

Coverage remained the same at 97.842% when pulling dc36090 on hitochan777:return-promise into f3566dd on bernabe9:master.

@bernabe9
Copy link
Owner

bernabe9 commented Nov 6, 2017

Good work 💪

About the global variables in the tests you're right, we should initialize them before each test. So, maybe we could open a new PR later to improve those test.

@bernabe9 bernabe9 merged commit f0a6f23 into bernabe9:master Nov 6, 2017
@hitochan777
Copy link
Contributor Author

@bernabe9 thanks for merging my PR! Yeah, definitely. we can work on it together.

@hitochan777 hitochan777 deleted the return-promise branch November 6, 2017 11:39
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.

3 participants