Skip to content

Instantly share code, notes, and snippets.

@erichulburd
Created December 23, 2017 00:36
Show Gist options
  • Save erichulburd/94b6d9263991c02d7da68918e2f60b9a to your computer and use it in GitHub Desktop.
Save erichulburd/94b6d9263991c02d7da68918e2f60b9a to your computer and use it in GitHub Desktop.
import { applyForce } from '../';
describe('applyForce epic', () => {
it('throttles and emits apply force if game ongoing', () => {
const testScheduler = new TestScheduler((actual, expected) => {
expect(actual).to.deep.equal(expected);
});
const action$ = new ActionsObservable(
testScheduler.createHotObservable('', {
// incoming actions
})
);
const store = {
getState: () => ({ /* some state */})
};
const test$ = applyForce(action$, store);
testScheduler.expectObservable(test$).toBe('', {
// actions epic emits
});
testScheduler.flush();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment