Skip to content

Commit

Permalink
chore(repeatWhen): add dtslint tests with deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh committed Mar 4, 2022
1 parent 8af48f7 commit c88da2c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec-dtslint/operators/repeatWhen-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { of } from 'rxjs';
import { repeatWhen } from 'rxjs/operators';

it('should infer correctly', () => {
const o = of(1, 2, 3).pipe(repeatWhen(errors => errors)); // $ExpectType Observable<number>
});

it('should infer correctly when the error observable has a different type', () => {
const o = of(1, 2, 3).pipe(repeatWhen(repeatWhen(errors => of('a', 'b', 'c')))); // $ExpectType Observable<number>
});

it('should enforce types', () => {
const o = of(1, 2, 3).pipe(repeatWhen()); // $ExpectError
});

it('should enforce types of the notifier', () => {
const o = of(1, 2, 3).pipe(repeatWhen(() => 8)); // $ExpectError
});

it('should be deprecated', () => {
const o = of(1, 2, 3).pipe(repeatWhen(() => of(true))); // $ExpectDeprecation
});

0 comments on commit c88da2c

Please sign in to comment.