Skip to content

Commit

Permalink
test: add failing test for ReactiveX#5237
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Jan 17, 2020
1 parent e6f8309 commit a7d113b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions spec/operators/finalize-spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { expect } from 'chai';
import { finalize, map, share } from 'rxjs/operators';
import { finalize, first, map, share } from 'rxjs/operators';
import { TestScheduler } from 'rxjs/testing';
import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing';
import { of, timer, interval } from 'rxjs';
import { of, timer, interval, NEVER } from 'rxjs';
import { asInteropOperator } from '../helpers/interop-helper';

declare const type: Function;

Expand Down Expand Up @@ -161,4 +162,18 @@ describe('finalize operator', () => {
rxTestScheduler.flush();
expect(executed).to.be.true;
});

it('should handle interop sources', (done: MochaDone) => {
// See https://github.com/ReactiveX/rxjs/issues/5237
let completed = false;
NEVER.pipe(
asInteropOperator(finalize(() => {
expect(completed).to.be.true;
done();
})),
asInteropOperator(first())
).subscribe(null, null, () => {
completed = true;
});
});
});

0 comments on commit a7d113b

Please sign in to comment.