Use async/await in auth store, added tests#88
Conversation
| }); | ||
|
|
||
| it("SET_AUTH", () => { | ||
| const stub = sinon.stub(JwtService, "saveToken"); |
There was a problem hiding this comment.
We do not need sinon here. Jest is capable of mocking JavaScript.
Resources
There was a problem hiding this comment.
Good point, too used to the mocha+sinon combo
| }; | ||
|
|
||
| const getters = { | ||
| export const getters = { |
There was a problem hiding this comment.
Why do we export this now?
There was a problem hiding this comment.
Good point, I'll remove these exports
| async [LOGIN](context, credentials) { | ||
| try { | ||
| const { | ||
| data: { user = {} } |
There was a problem hiding this comment.
Can we keep Object destructuring at one level? Otherwise, it gets unreadable.
There was a problem hiding this comment.
I tend to quite like nested destructuring since it allows you to easily assign default values without having to do a separate check at each level and assign new variable names. I accept that it can make it a bit less readable for people not used to it though so I'll simplify it.
| }; | ||
|
|
||
| const mutations = { | ||
| export const mutations = { |
There was a problem hiding this comment.
I do not think we need to export this
… refactored object destructuring
Addresses issue #58