Created
March 23, 2021 12:36
-
-
Save pjurczynski/72d6afec1f4d16851fbfc9f376761dc3 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
import { combineLatest } from 'rxjs'; | |
import { TestScheduler } from 'rxjs/testing'; | |
const testScheduler = new TestScheduler((actual, expected) => { | |
expect(actual).toEqual(expected); | |
}); | |
describe('simple example of rxjs-marbles', () => { | |
it('combineLatest', () => { | |
testScheduler.run(({ expectObservable, cold, hot, expectSubscriptions, flush }) => { | |
const a$ = cold('--a---'); // of('a'); | |
const b$ = cold('----b-'); // of('b'); | |
const expected ='----x-'; //prettier-ignore | |
const testSubject$ = combineLatest([a$, b$]); | |
expectObservable(testSubject$).toBe(expected, { x: ['a', 'b'] }); | |
// combineLatest([a$, b$]).subscribe(([a, b]) => {}) | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment