Created
June 28, 2016 17:04
-
-
Save smashercosmo/6b4568cbc0a19a29550334ce0ea95ebb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function fetchUser(id) { | |
return (dispatch, getState, {analytics, api}) => { | |
return api.fetchUser().then(user => { | |
analytics.track(...); | |
}) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {fetchUser} from './user.actions'; | |
describe('fetchUser', () => { | |
it('should fetch user', () => { | |
fetchUser('1')(mockDispatch, mockGetState, {api: mockApi, analytics: mockAnalytics}); | |
/* your assertions */ | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment