diff --git a/spec/operators/shareReplay-spec.ts b/spec/operators/shareReplay-spec.ts index 96a4c9e2c2..020209826e 100644 --- a/spec/operators/shareReplay-spec.ts +++ b/spec/operators/shareReplay-spec.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; import { shareReplay, mergeMapTo, retry } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; -import { Observable, Operator, Observer, of } from 'rxjs'; +import { Observable, Operator, Observer, of, from } from 'rxjs'; declare const rxTestScheduler: TestScheduler; @@ -267,7 +267,15 @@ describe('shareReplay operator', () => { }); it('should not skip values on a sync source', () => { - const a = cold( '(abcd)'); + const a = from(['a', 'b', 'c', 'd']); + // We would like for the previous line to read like this: + // + // const a = cold('(abcd|)'); + // + // However, that would synchronously emit multiple values at frame 0, + // but it's not synchronous upon-subscription. + // TODO: revisit once https://github.com/ReactiveX/rxjs/issues/5523 is fixed + const x = cold( 'x-------x'); const expected = '(abcd)--d';