Skip to content

Instantly share code, notes, and snippets.

@DanielRamosAcosta
Created August 14, 2018 20:11
Show Gist options
  • Save DanielRamosAcosta/9f9a8831c3d5c3331424962c5ae61c2a to your computer and use it in GitHub Desktop.
Save DanielRamosAcosta/9f9a8831c3d5c3331424962c5ae61c2a to your computer and use it in GitHub Desktop.
RxJS test with marble iagrams
it('multiplies each number by 2', () => {
createScheduler().run(({ cold, expectObservable }) => {
const values = { a: 1, b: 2, c: 3, x: 2, y: 4, z: 6 }
const numbers$ = cold('a-b-c-|', values) as Observable<number>
const resultDiagram = 'x-y-z-|'
expectObservable(numTwoTimes(numbers$)).toBe(resultDiagram, values)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment