Created
December 23, 2017 00:39
-
-
Save erichulburd/275b52967755745d7ea764f4c03e8713 to your computer and use it in GitHub Desktop.
This file contains 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
context('game is paused', () => { | |
it(`interval starts when user starts game and is stopped when end emitted`, () => { | |
const testScheduler = new TestScheduler((actual, expected) => { | |
expect(actual).to.deep.equal(expected); | |
}); | |
const interval$ = testScheduler.createColdObservable('--a--b--c', { | |
a: 0, | |
b: 1, | |
c: 2 | |
}); | |
sinon.stub(Observable, 'interval').returns(interval$); | |
const store = { | |
getState: () => ({ | |
game: { /* game is paused */ } | |
}) | |
}; | |
const action$ = new ActionsObservable( | |
testScheduler.createHotObservable('', { | |
// incoming actions | |
}) | |
); | |
const test$ = game(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