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

test: add v8 subscriber-should-stay-closed test #5186

Merged
merged 1 commit into from Dec 20, 2019
Merged
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
31 changes: 30 additions & 1 deletion spec/operators/catch-spec.ts
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import { concat, defer, Observable, of, throwError, EMPTY, from } from 'rxjs';
import { catchError, map, mergeMap, takeWhile } from 'rxjs/operators';
import { catchError, delay, map, mergeMap, takeWhile } from 'rxjs/operators';
import * as sinon from 'sinon';
import { createObservableInputs } from '../helpers/test-helper';
import { TestScheduler } from 'rxjs/testing';
Expand Down Expand Up @@ -430,4 +430,33 @@ describe('catchError operator', () => {
});
});

// TODO(v8): see https://github.com/ReactiveX/rxjs/issues/5115
// The re-implementation in version 8 should fix the problem in the
// referenced issue. Closed subscribers should remain closed.
/*
it('issue #5115', (done: MochaDone) => {
const source = new Observable<string>(observer => {
observer.error(new Error('kaboom!'));
observer.complete();
});

const sourceWithDelay = new Observable<string>(observer => {
observer.next('delayed');
observer.complete();
}).pipe(delay(0));

const values: string[] = [];
source.pipe(
catchError(err => sourceWithDelay)
)
.subscribe(
value => values.push(value),
err => done(err),
() => {
expect(values).to.deep.equal(['delayed']);
done();
}
);
});
*/
});