Created
September 27, 2017 20:00
-
-
Save jaredlockhart/e8fc88a127868afbfde3cb5aa6e9d458 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
38 it('should send experiment to normandy and send accept to experimenter', async () => { | |
39 const experiment = ExperimentFactory.build(); | |
40 const createRecipeResponse = {}; | |
41 fetchMock.mock('/api/v2/recipe/', createRecipeResponse, {method: 'POST'}); | |
42 fetchMock.mock(experiment.accept_url, 'accepted', {method: 'PATCH'}); | |
43 | |
44 const dispatch = action => { | |
45 console.log('dispatch called'); | |
46 switch (typeof action) { | |
47 case "function": | |
48 console.log('function received, invoking with this'); | |
49 return action(this); | |
50 case "object": | |
51 console.log('object received, its an action!', action); | |
52 } | |
53 }; | |
54 | |
55 await importExperiment(experiment)(dispatch); | |
56 }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment