Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// ... | |
it('does not restart game when ongoing and emits end event when user loses', () => { | |
const testScheduler = new TestScheduler((actual, expected) => { | |
expect(actual).to.deep.equal(expected); | |
}); | |
const interval$ = testScheduler.createColdObservable('--a--b', { | |
a: 0, | |
a: 1 |
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('user will lose', () => { | |
afterEach(() => { | |
Observable.interval.restore(); | |
}); | |
it('does not restart game when ongoing and emits end event when user loses', () => { | |
const testScheduler = new TestScheduler((actual, expected) => { | |
expect(actual).to.deep.equal(expected); | |
}); |
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', () => { | |
afterEach(() => { | |
Observable.interval.restore(); | |
}); | |
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); | |
}); |
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 |
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
it('throttles, but does not emit applyForce if game is not 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) | |
}) | |
); |
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
import sinon from 'sinon'; | |
// ... | |
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', { |
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
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) | |
}) | |
); |
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
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( |
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
import { combineEpics } from 'redux-observable'; | |
//... | |
const applyForce = //... | |
const game = //... | |
export default combineEpics( | |
game, | |
applyForce | |
); |
NewerOlder