|
1 | 1 | /** @prettier */
|
2 | 2 | import { expect } from 'chai';
|
3 |
| -import { take, mergeMap } from 'rxjs/operators'; |
4 |
| -import { of, Observable, Subject } from 'rxjs'; |
| 3 | +import { merge, Observable, of, Subject } from 'rxjs'; |
| 4 | +import { mergeMap, take, tap } from 'rxjs/operators'; |
5 | 5 | import { TestScheduler } from 'rxjs/testing';
|
6 | 6 | import { observableMatcher } from '../helpers/observableMatcher';
|
7 | 7 |
|
@@ -217,4 +217,21 @@ describe('take', () => {
|
217 | 217 | expectSubscriptions(e1.subscriptions).toBe(e1subs);
|
218 | 218 | });
|
219 | 219 | });
|
| 220 | + |
| 221 | + it.skip('should unsubscribe from the source when it reaches the limit before a recursive synchronous upstream error is notified', () => { |
| 222 | + testScheduler.run(({ cold, expectObservable, expectSubscriptions }) => { |
| 223 | + const subject = new Subject(); |
| 224 | + const e1 = cold(' (a|)'); |
| 225 | + const e1subs = ' (^!)'; |
| 226 | + const expected = '(a|)'; |
| 227 | + |
| 228 | + const result = merge(e1, subject).pipe( |
| 229 | + take(1), |
| 230 | + tap(() => subject.error('error')) |
| 231 | + ); |
| 232 | + |
| 233 | + expectObservable(result).toBe(expected); |
| 234 | + expectSubscriptions(e1.subscriptions).toBe(e1subs); |
| 235 | + }); |
| 236 | + }); |
220 | 237 | });
|
0 commit comments