Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #2457 for v6 #3963

Merged
merged 3 commits into from
Jul 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 19 additions & 19 deletions spec/operators/concatMap-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('Observable.prototype.concatMap', () => {
const d = cold( '------(d|)');
const dsubs = ' ^ ! ';
const e1 = hot('a---b--------------------c-d----| ');
const e1subs = '^ ! ';
const e1subs = '^ ! ';
const expected = '--a-a-a-a---b--b--b-------c-c-c-----(d|)';

const observableLookup = { a: a, b: b, c: c, d: d };
Expand All @@ -104,12 +104,12 @@ describe('Observable.prototype.concatMap', () => {
it('should concatMap many outer values to many inner values', () => {
const values = {i: 'foo', j: 'bar', k: 'baz', l: 'qux'};
const e1 = hot('-a---b---c---d---| ');
const e1subs = '^ !';
const inner = cold('--i-j-k-l-| ', values);
const e1subs = '^ ! ';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ ! ',
' ^ ! ',
' ^ !'];
' ^ ! ',
' ^ ! ',
' ^ !'];
const expected = '---i-j-k-l---i-j-k-l---i-j-k-l---i-j-k-l-|';

const result = e1.pipe(concatMap((value) => inner));
Expand Down Expand Up @@ -166,8 +166,8 @@ describe('Observable.prototype.concatMap', () => {
const e1subs = '^ ! ';
const inner = cold('|');
const innersubs = [' (^!) ',
' (^!) ',
' (^!)'];
' (^!) ',
' (^!)'];
const expected = '---------| ';

const result = e1.pipe(concatMap(() => { return inner; }));
Expand All @@ -179,7 +179,7 @@ describe('Observable.prototype.concatMap', () => {

it('should return a never if the mapped inner is never', () => {
const e1 = cold( '--a-b--c-|');
const e1subs = '^ ';
const e1subs = '^ !';
const inner = cold('-');
const innersubs = ' ^ ';
const expected = '----------';
Expand Down Expand Up @@ -211,9 +211,9 @@ describe('Observable.prototype.concatMap', () => {
const e1subs = '^ !';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ ! ',
' ^ ! ',
' ^ ! '];
' ^ ! ',
' ^ ! ',
' ^ ! '];
const expected = '---i-j-k-l---i-j-k-l---i-j-k-l---i-j-k-l--------|';

const result = e1.pipe(concatMap((value) => inner));
Expand All @@ -229,9 +229,9 @@ describe('Observable.prototype.concatMap', () => {
const e1subs = '^ ';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ ! ',
' ^ ! ',
' ^ ! '];
' ^ ! ',
' ^ ! ',
' ^ ! '];
const expected = '---i-j-k-l---i-j-k-l---i-j-k-l---i-j-k-l---------';

const result = e1.pipe(concatMap((value) => inner));
Expand All @@ -244,7 +244,7 @@ describe('Observable.prototype.concatMap', () => {
it('should concatMap many outer to many inner, inner never completes', () => {
const values = {i: 'foo', j: 'bar', k: 'baz', l: 'qux'};
const e1 = hot('-a---b---c---d---|');
const e1subs = '^ ';
const e1subs = '^ !';
const inner = cold('--i-j-k-l- ', values);
const innersubs = ' ^ ';
const expected = '---i-j-k-l--------';
Expand Down Expand Up @@ -277,7 +277,7 @@ describe('Observable.prototype.concatMap', () => {
const e1subs = '^ !';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ !'];
' ^ !'];
const expected = '---i-j-k-l---i-j-#';

const result = e1.pipe(concatMap((value) => inner));
Expand Down Expand Up @@ -318,7 +318,7 @@ describe('Observable.prototype.concatMap', () => {
const g = cold( '---1-2|');
const gsubs = ' ^ !';
const e1 = hot('-a-b--^-c-----d------e----------------f-----g| ');
const e1subs = '^ !';
const e1subs = '^ ! ';
const expected = '---2--3--4--5----6-----2--3-1------2--3-4-5--------1-2|';
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };

Expand Down Expand Up @@ -351,7 +351,7 @@ describe('Observable.prototype.concatMap', () => {
const g = cold( '---1-2|');
const gsubs: string[] = [];
const e1 = hot('-a-b--^-c-----d------e----------------f-----g| ');
const e1subs = '^ ';
const e1subs = '^ ! ' ;
const expected = '---2--3--4--5----6-----2--3----------------------------';
const observableLookup = { a: a, b: b, c: c, d: d, e: e, f: f, g: g };

Expand Down
34 changes: 17 additions & 17 deletions spec/operators/concatMapTo-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ describe('Observable.prototype.concatMapTo', () => {
it('should concatMapTo many outer values to many inner values', () => {
const values = {i: 'foo', j: 'bar', k: 'baz', l: 'qux'};
const e1 = hot('-a---b---c---d---| ');
const e1subs = '^ !';
const e1subs = '^ ! ';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ ! ',
' ^ ! ',
' ^ !'];
' ^ ! ',
' ^ ! ',
' ^ !'];
const expected = '---i-j-k-l---i-j-k-l---i-j-k-l---i-j-k-l-|';

const result = e1.pipe(concatMapTo(inner));
Expand Down Expand Up @@ -142,8 +142,8 @@ describe('Observable.prototype.concatMapTo', () => {
const e1subs = '^ !';
const inner = cold('|');
const innersubs = [' (^!) ',
' (^!) ',
' (^!)'];
' (^!) ',
' (^!)'];
const expected = '---------|';

const result = e1.pipe(concatMapTo(inner));
Expand All @@ -155,7 +155,7 @@ describe('Observable.prototype.concatMapTo', () => {

it('should return a never if the mapped inner is never', () => {
const e1 = cold('--a-b--c-|');
const e1subs = '^ ';
const e1subs = '^ !';
const inner = cold('-');
const innersubs = ' ^ ';
const expected = '----------';
Expand Down Expand Up @@ -187,9 +187,9 @@ describe('Observable.prototype.concatMapTo', () => {
const e1subs = '^ !';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ ! ',
' ^ ! ',
' ^ ! '];
' ^ ! ',
' ^ ! ',
' ^ ! '];
const expected = '---i-j-k-l---i-j-k-l---i-j-k-l---i-j-k-l--------|';

const result = e1.pipe(concatMapTo(inner));
Expand All @@ -205,9 +205,9 @@ describe('Observable.prototype.concatMapTo', () => {
const e1subs = '^ ';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ ! ',
' ^ ! ',
' ^ ! '];
' ^ ! ',
' ^ ! ',
' ^ ! '];
const expected = '---i-j-k-l---i-j-k-l---i-j-k-l---i-j-k-l---------';

const result = e1.pipe(concatMapTo(inner));
Expand All @@ -220,10 +220,10 @@ describe('Observable.prototype.concatMapTo', () => {
it('should not break unsubscription chains when result is unsubscribed explicitly', () => {
const values = {i: 'foo', j: 'bar', k: 'baz', l: 'qux'};
const e1 = hot('-a---b---c---d---| ');
const e1subs = '^ !';
const e1subs = '^ ! ';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ !'];
' ^ !'];
const expected = '---i-j-k-l---i-j-k-';
const unsub = ' !';

Expand All @@ -241,7 +241,7 @@ describe('Observable.prototype.concatMapTo', () => {
it('should concatMapTo many outer to many inner, inner never completes', () => {
const values = {i: 'foo', j: 'bar', k: 'baz', l: 'qux'};
const e1 = hot('-a---b---c---d---|');
const e1subs = '^ ';
const e1subs = '^ !';
const inner = cold('--i-j-k-l- ', values);
const innersubs = ' ^ ';
const expected = '---i-j-k-l--------';
Expand Down Expand Up @@ -274,7 +274,7 @@ describe('Observable.prototype.concatMapTo', () => {
const e1subs = '^ !';
const inner = cold('--i-j-k-l-| ', values);
const innersubs = [' ^ ! ',
' ^ !'];
' ^ !'];
const expected = '---i-j-k-l---i-j-#';

const result = e1.pipe(concatMapTo(inner));
Expand Down
16 changes: 8 additions & 8 deletions spec/operators/delay-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('delay operator', () => {
const e1 = hot('---a--b--| ');
const t = time( '--| ');
const expected = '-----a--b--|';
const subs = '^ !';
const subs = '^ ! ';

const result = e1.pipe(delay(t, rxTestScheduler));

Expand All @@ -23,10 +23,10 @@ describe('delay operator', () => {
});

it('should delay by absolute time period', () => {
const e1 = hot('--a--b--| ');
const t = time( '---| ');
const e1 = hot('--a--b--| ');
const t = time( '---| ');
const expected = '-----a--b--|';
const subs = '^ !';
const subs = '^ ! ';

const absoluteDelay = new Date(rxTestScheduler.now() + t);
const result = e1.pipe(delay(absoluteDelay, rxTestScheduler));
Expand All @@ -36,10 +36,10 @@ describe('delay operator', () => {
});

it('should delay by absolute time period after subscription', () => {
const e1 = hot('---^--a--b--| ');
const t = time( '---| ');
const e1 = hot('---^--a--b--| ');
const t = time( '---| ');
const expected = '------a--b--|';
const subs = '^ !';
const subs = '^ ! ';

const absoluteDelay = new Date(rxTestScheduler.now() + t);
const result = e1.pipe(delay(absoluteDelay, rxTestScheduler));
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('delay operator', () => {
const e1 = hot('----| ');
const t = time( '---|');
const expected = '-------|';
const subs = '^ !';
const subs = '^ ! ';

const result = e1.pipe(delay(t, rxTestScheduler));

Expand Down
28 changes: 14 additions & 14 deletions spec/operators/delayWhen-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('delayWhen operator', () => {
asDiagram('delayWhen(durationSelector)')('should delay by duration selector', () => {
const e1 = hot('---a---b---c--|');
const expected = '-----a------c----(b|)';
const subs = '^ !';
const subs = '^ !';
const selector = [cold( '--x--|'),
cold( '----------(x|)'),
cold( '-x--|')];
Expand Down Expand Up @@ -41,7 +41,7 @@ describe('delayWhen operator', () => {
const subs = '^ !';
const selector = cold( '-x--|');
const selectorSubs = [' ^! ',
' ^! '];
' ^! '];

const result = e1.pipe(delayWhen((x: any) => selector));

Expand Down Expand Up @@ -81,10 +81,10 @@ describe('delayWhen operator', () => {
it('should delay by selector and completes after value emits', () => {
const e1 = hot('--a--b--|');
const expected = '---------a--(b|)';
const subs = '^ !';
const subs = '^ !';
const selector = cold('-------x--|');
const selectorSubs = [' ^ !',
' ^ !'];
' ^ !'];

const result = e1.pipe(delayWhen((x: any) => selector));

Expand All @@ -96,10 +96,10 @@ describe('delayWhen operator', () => {
it('should delay by selector completes if selector does not emits', () => {
const e1 = hot('--a--b--|');
const expected = '------a--(b|)';
const subs = '^ !';
const subs = '^ !';
const selector = cold( '----|');
const selectorSubs = [' ^ !',
' ^ !'];
' ^ !'];

const result = e1.pipe(delayWhen((x: any) => selector));

Expand Down Expand Up @@ -133,10 +133,10 @@ describe('delayWhen operator', () => {
it('should not emit if selector never emits', () => {
const e1 = hot('--a--b--|');
const expected = '-';
const subs = '^ ';
const subs = '^ !';
const selector = cold( '-');
const selectorSubs = [' ^ ',
' ^ '];
const selectorSubs = [' ^ ',
' ^ '];

const result = e1.pipe(delayWhen((x: any) => selector));

Expand All @@ -148,10 +148,10 @@ describe('delayWhen operator', () => {
it('should delay by first value from selector', () => {
const e1 = hot('--a--b--|');
const expected = '------a--(b|)';
const subs = '^ !';
const subs = '^ !';
const selector = cold( '----x--y--|');
const selectorSubs = [' ^ !',
' ^ !'];
' ^ !'];

const result = e1.pipe(delayWhen((x: any) => selector));

Expand All @@ -163,10 +163,10 @@ describe('delayWhen operator', () => {
it('should delay by selector does not completes', () => {
const e1 = hot('--a--b--|');
const expected = '------a--(b|)';
const subs = '^ !';
const subs = '^ !';
const selector = cold( '----x-----y---');
const selectorSubs = [' ^ !',
' ^ !'];
' ^ !'];

const result = e1.pipe(delayWhen((x: any) => selector));

Expand Down Expand Up @@ -211,7 +211,7 @@ describe('delayWhen operator', () => {
const subs = ' ^ !';
const selector = cold( '--x--|');
const selectorSubs = [' ^ !',
' ^ !'];
' ^ !'];
const subDelay = cold('--|');
const subDelaySub = '^ !';

Expand Down
8 changes: 4 additions & 4 deletions spec/operators/exhaustMap-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ describe('exhaustMap', () => {
const z = cold( '--g--h--i-----');
const zsubs = ' ^ ';
const e1 = hot('---x---------y-----------------z---------| ');
const e1subs = '^ ';
const e1subs = '^ ! ';
const expected = '-----a--b--c---------------------g--h--i-----';

const observableLookup = { x: x, y: y, z: z };
Expand Down Expand Up @@ -270,7 +270,7 @@ describe('exhaustMap', () => {
const z = hot('---z-o-o-m-------------j---k---l---m--|');
const zsubs = ' ^ !';
const e1 = hot('---------x----y-----z--------| ');
const e1subs = '^ !';
const e1subs = '^ ! ';
const expected = '-----------c--d--e-----j---k---l---m--|';

const observableLookup = { x: x, y: y, z: z };
Expand Down Expand Up @@ -309,7 +309,7 @@ describe('exhaustMap', () => {
const xsubs = ' (^!) ';
const ysubs = ' ^ ';
const e1 = hot('---------x---------y---------|');
const e1subs = '^ ';
const e1subs = '^ !';
const expected = '------------------------------';

const observableLookup = { x: x, y: y };
Expand All @@ -328,7 +328,7 @@ describe('exhaustMap', () => {
const xsubs = ' ^ ';
const ysubs: string[] = [];
const e1 = hot('---------x---------y----------|');
const e1subs = '^ ';
const e1subs = '^ !';
const expected = '-------------------------------';

const observableLookup = { x: x, y: y };
Expand Down