Skip to content

Instantly share code, notes, and snippets.

@panvourtsis
Created March 8, 2019 15:22
Show Gist options
  • Save panvourtsis/0bcfd3a02aefc4273beedf9591ab0073 to your computer and use it in GitHub Desktop.
Save panvourtsis/0bcfd3a02aefc4273beedf9591ab0073 to your computer and use it in GitHub Desktop.
import { ActionsObservable, StateObservable } from 'redux-observable';
...
it('expects to work perfectly', async () => {
const mockedResponse = {};
const action$ = ActionsObservable.of(action.actionRequest());
const expected = [
addDataAction(mockedResponse), // action 1
pushInfoSnackbar('created successfully') // action 2
];
mockAxios.onGet().reply(200, mockedResponse);
const epic = await exampleEpic(action$)
.pipe(toArray())
.toPromise();
expect(epic).toEqual(expected);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment