Skip to content

Instantly share code, notes, and snippets.

@adrianfaciu
Created August 28, 2017 15:44
Show Gist options
  • Save adrianfaciu/8aa0da0f22b41822224e88d229439487 to your computer and use it in GitHub Desktop.
Save adrianfaciu/8aa0da0f22b41822224e88d229439487 to your computer and use it in GitHub Desktop.
it('can fetch data with debounce (test scheduler)', () => {
const source = cold('a', { a: { type: actions.DATA_WITH_DEBOUNCE_FETCH } });
mockObservableWithScheduler(getTestScheduler());
const effect = new AppTimeEffect(new Actions(source));
// - is a 10 frame interval, since we use 100 in the effect we use 10 - characters
const expected = cold('----------a', { a: { type: actions.DATA_WITH_DEBOUNCE_FETCH_SUCCESS } });
expect(effect.fetchDataWithDebounce$).toBeObservable(expected);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment