Skip to content

Instantly share code, notes, and snippets.

@pjurczynski
Created March 23, 2021 12:36
Show Gist options
  • Save pjurczynski/72d6afec1f4d16851fbfc9f376761dc3 to your computer and use it in GitHub Desktop.
Save pjurczynski/72d6afec1f4d16851fbfc9f376761dc3 to your computer and use it in GitHub Desktop.
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