Skip to content

Commit a756654

Browse files
committed
chore(repeatWhen): add dtslint tests with deprecation
1 parent 497cdcf commit a756654

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { of } from 'rxjs';
2+
import { repeatWhen } from 'rxjs/operators';
3+
4+
it('should infer correctly', () => {
5+
const o = of(1, 2, 3).pipe(repeatWhen(errors => errors)); // $ExpectType Observable<number>
6+
});
7+
8+
it('should infer correctly when the error observable has a different type', () => {
9+
const o = of(1, 2, 3).pipe(repeatWhen(repeatWhen(errors => of('a', 'b', 'c')))); // $ExpectType Observable<number>
10+
});
11+
12+
it('should enforce types', () => {
13+
const o = of(1, 2, 3).pipe(repeatWhen()); // $ExpectError
14+
});
15+
16+
it('should enforce types of the notifier', () => {
17+
const o = of(1, 2, 3).pipe(repeatWhen(() => 8)); // $ExpectError
18+
});
19+
20+
it('should be deprecated', () => {
21+
const o = of(1, 2, 3).pipe(repeatWhen(() => of(true))); // $ExpectDeprecation
22+
});

0 commit comments

Comments
 (0)