Skip to content

Commit

Permalink
chore: add test comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Nov 27, 2019
1 parent 3c9cf99 commit 64e0480
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/operators/catch-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ describe('catchError operator', () => {
const expected = '-1-2-3-5-6-7- ';
const unsub = ' ------------! ';

// This test is the same as the previous test, but the observable is
// manipulated to make it look like an interop observable - an observable
// from a foreign library. Interop subscribers are treated differently:
// the are wrapped in a safe subscriber. This test ensures that
// unsubscriptions are chained all the way to the interop subscriber.

const result = e1.pipe(catchError(() => asInteropObservable(e2)));

expectObservable(result, unsub).toBe(expected);
Expand Down
6 changes: 6 additions & 0 deletions spec/operators/exhaustMap-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ describe('exhaustMap', () => {

const observableLookup = { x: x, y: y, z: z };

// This test is the same as the previous test, but the observable is
// manipulated to make it look like an interop observable - an observable
// from a foreign library. Interop subscribers are treated differently:
// the are wrapped in a safe subscriber. This test ensures that
// unsubscriptions are chained all the way to the interop subscriber.

const result = e1.pipe(
mergeMap(x => of(x)),
exhaustMap(value => asInteropObservable(observableLookup[value])),
Expand Down
6 changes: 6 additions & 0 deletions spec/operators/mergeMap-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ describe('mergeMap', () => {

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

// This test manipulates the observable to make it look like an interop
// observable - an observable from a foreign library. Interop subscribers
// are treated differently: the are wrapped in a safe subscriber. This
// test ensures that unsubscriptions are chained all the way to the
// interop subscriber.

const result = e1.pipe(
mergeMap(x => of(x)),
mergeMap(value => asInteropObservable(observableLookup[value])),
Expand Down
6 changes: 6 additions & 0 deletions spec/operators/onErrorResumeNext-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ describe('onErrorResumeNext operator', () => {
const subs = '^ !';
const expected = '--a--b----c--';

// This test manipulates the observable to make it look like an interop
// observable - an observable from a foreign library. Interop subscribers
// are treated differently: the are wrapped in a safe subscriber. This
// test ensures that unsubscriptions are chained all the way to the
// interop subscriber.

expectObservable(source.pipe(onErrorResumeNext(asInteropObservable(next))), subs).toBe(expected);
expectSubscriptions(next.subscriptions).toBe(nextSubs);
});
Expand Down
6 changes: 6 additions & 0 deletions spec/operators/skipUntil-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ describe('skipUntil', () => {
const expected = ('---------- ');
const unsub = ' ! ';

// This test is the same as the previous test, but the observable is
// manipulated to make it look like an interop observable - an observable
// from a foreign library. Interop subscribers are treated differently:
// the are wrapped in a safe subscriber. This test ensures that
// unsubscriptions are chained all the way to the interop subscriber.

const result = e1.pipe(
mergeMap(x => of(x)),
skipUntil(asInteropObservable(skip)),
Expand Down
6 changes: 6 additions & 0 deletions spec/operators/switchMap-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ describe('switchMap', () => {

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

// This test is the same as the previous test, but the observable is
// manipulated to make it look like an interop observable - an observable
// from a foreign library. Interop subscribers are treated differently:
// the are wrapped in a safe subscriber. This test ensures that
// unsubscriptions are chained all the way to the interop subscriber.

const result = e1.pipe(
mergeMap(x => of(x)),
switchMap(value => asInteropObservable(observableLookup[value])),
Expand Down

0 comments on commit 64e0480

Please sign in to comment.