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

Tests asserting unsubscription chains don't break #875

Closed
88 tasks done
staltz opened this issue Dec 3, 2015 · 2 comments
Closed
88 tasks done

Tests asserting unsubscription chains don't break #875

staltz opened this issue Dec 3, 2015 · 2 comments
Labels
help wanted Issues we wouldn't mind assistance with.

Comments

@staltz
Copy link
Member

staltz commented Dec 3, 2015

We need to add tests that each operator propagates unsubscription from the destination to the source.

Here is an example:

  it('should not break unsubscription chain when unsubscribed explicitly', function () {
    var e1 =     hot('--a--b--c--d--e----|');
    var unsub =      '         !          ';
    var e1subs =     '^        !          ';
    var skip =   hot('-------------x--|   ');
    var skipSubs =   '^        !          ';
    var expected =  ('----------          ');

    var result = e1
      .mergeMap(function (x) { return Observable.of(x); })
      .skipUntil(skip)
      .mergeMap(function (x) { return Observable.of(x); });

    expectObservable(result, unsub).toBe(expected);
    expectSubscriptions(e1.subscriptions).toBe(e1subs);
    expectSubscriptions(skip.subscriptions).toBe(skipSubs);
  });

Notice the use of the mergeMap sandwich there.


  • buffer
  • bufferCount
  • bufferTime
  • bufferToggle
  • bufferWhen
  • catch
  • combineAll
  • combineLatest
  • concat-static
  • concat
  • concatAll
  • concatMap
  • concatMapTo
  • count
  • debounce
  • debounceTime
  • defaultIfEmpty
  • delay
  • dematerialize
  • distinctUntilChanged
  • distinctUntilKeyChanged
  • do
  • elementAt
  • every
  • exhaust
  • exhaustMap
  • expand
  • filter
  • find
  • findIndex
  • first
  • groupBy
  • ignoreElements
  • isEmpty
  • last
  • map
  • mapTo
  • materialize
  • max
  • merge-static
  • merge
  • mergeAll
  • mergeMap
  • mergeMapTo
  • mergeScan
  • min
  • multicast
  • observeOn
  • partition
  • publish
  • publishBehavior
  • publishLast
  • publishReplay
  • reduce
  • repeat
  • retry
  • retryWhen
  • sample
  • sampleTime
  • scan
  • share
  • single
  • skip
  • skipUntil
  • skipWhile
  • startWith
  • subscribeOn
  • switch
  • switchMap
  • switchMapTo
  • take
  • takeUntil
  • takeWhile
  • throttle
  • throttleTime
  • timeInterval
  • timeout
  • timeoutWith
  • toArray
  • window
  • windowCount
  • windowTime
  • windowToggle
  • windowWhen
  • withLatestFrom
  • zip-static
  • zip
  • zipAll
@benlesh benlesh added the help wanted Issues we wouldn't mind assistance with. label Dec 3, 2015
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 4, 2015
Add test that catch() should not break unsubscription chain.

For issue ReactiveX#875.
benlesh pushed a commit that referenced this issue Dec 4, 2015
Add test that catch() should not break unsubscription chain.

For issue #875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 5, 2015
Add test for repeat() operator to verify that unsubscription chains are not broken when unsubscribe
happens.

For issue ReactiveX#875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 5, 2015
Fix repeat() operator to add its own Subscriber to the destination Subscriber, in order to avoid
breaking unsubscription chains.

For issue ReactiveX#875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 5, 2015
Add test for retry() operator to verify that unsubscription chains are not broken when unsubscribe
happens.

For issue ReactiveX#875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 5, 2015
Fix retry() operator to add its own Subscriber to the destination Subscriber, in order to avoid
breaking unsubscription chains.

For issue ReactiveX#875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 5, 2015
Add test for retryWhen() operator to verify that unsubscription chains are not broken when
unsubscribe happens.

For issue ReactiveX#875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 5, 2015
Fix retryWhen() operator to add its own Subscriber to the destination Subscriber, in order to avoid
breaking unsubscription chains.

For issue ReactiveX#875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 5, 2015
Add test for groupBy() operator, to verify that unsubscription chains are not broken when the
observable is unsubscribed explicitly.

For issue ReactiveX#875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 5, 2015
Add test for share() operator, to verify that unsubscription chains are not broken when the last
subscriber unsubscribes.

For issue ReactiveX#875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 6, 2015
Add test for share() operator, to verify that unsubscription chains are not broken when the last
subscriber unsubscribes.

For issue ReactiveX#875.
luisgabriel added a commit to luisgabriel/RxJS that referenced this issue Dec 7, 2015
luisgabriel added a commit to luisgabriel/RxJS that referenced this issue Dec 7, 2015
luisgabriel added a commit to luisgabriel/RxJS that referenced this issue Dec 7, 2015
figueredo added a commit to figueredo/RxJS that referenced this issue Dec 7, 2015
figueredo added a commit to figueredo/RxJS that referenced this issue Dec 7, 2015
figueredo added a commit to figueredo/RxJS that referenced this issue Dec 7, 2015
figueredo added a commit to figueredo/RxJS that referenced this issue Dec 7, 2015
figueredo added a commit to figueredo/RxJS that referenced this issue Dec 7, 2015
benlesh pushed a commit that referenced this issue Dec 8, 2015
Add test for repeat() operator to verify that unsubscription chains are not broken when unsubscribe
happens.

For issue #875.
benlesh pushed a commit that referenced this issue Dec 8, 2015
Fix repeat() operator to add its own Subscriber to the destination Subscriber, in order to avoid
breaking unsubscription chains.

For issue #875.
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 8, 2015
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 8, 2015
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 8, 2015
kwonoj pushed a commit that referenced this issue Dec 8, 2015
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 8, 2015
kwonoj pushed a commit that referenced this issue Dec 8, 2015
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 8, 2015
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 8, 2015
staltz added a commit to staltz/RxJSNext that referenced this issue Dec 8, 2015
Add test case to verify that unsubscription chains are not broken. Add test that asserts
subscriptions when an unsubscription happens explicitly.

Related to issue ReactiveX#875.
benlesh pushed a commit that referenced this issue Dec 9, 2015
Add test case to verify that unsubscription chains are not broken. Add test that asserts
subscriptions when an unsubscription happens explicitly.

Related to issue #875.
@staltz
Copy link
Member Author

staltz commented Dec 16, 2015

All done. Closed.

@staltz staltz closed this as completed Dec 16, 2015
@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Issues we wouldn't mind assistance with.
Projects
None yet
Development

No branches or pull requests

2 participants