Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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('aaab', {
a: actions.applyForce.click(2),
b: actions.applyForce.click(3)
})
);
const throttle$ = testScheduler.createColdObservable('---a', {
a: actions.applyForce.click(3)
});
sinon.stub(Observable.prototype, 'throttleTime').returns(throttle$);
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
You can’t perform that action at this time.