Skip to content

Commit 7eeb671

Browse files
dkosasihcartant
authored andcommitted
test(dtslint): add dtslint test for endWith operator (#4093) (#4175)
1 parent 028adbd commit 7eeb671

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { of, asyncScheduler } from 'rxjs';
2+
import { endWith } from 'rxjs/operators';
3+
4+
it('should support a scheduler', () => {
5+
const a = of(1, 2, 3).pipe(endWith(asyncScheduler)); // $ExpectType Observable<number>
6+
});
7+
8+
it('should infer type for 1 parameter', () => {
9+
const a = of(1, 2, 3).pipe(endWith(4)); // $ExpectType Observable<number>
10+
});
11+
12+
it('should infer type for 2 parameter', () => {
13+
const a = of(1, 2, 3).pipe(endWith(4, 5)); // $ExpectType Observable<number>
14+
});
15+
16+
it('should infer type for 3 parameter', () => {
17+
const a = of(1, 2, 3).pipe(endWith(4, 5, 6)); // $ExpectType Observable<number>
18+
});
19+
20+
it('should infer type for 4 parameter', () => {
21+
const a = of(1, 2, 3).pipe(endWith(4, 5, 6, 7)); // $ExpectType Observable<number>
22+
});
23+
24+
it('should infer type for 5 parameter', () => {
25+
const a = of(1, 2, 3).pipe(endWith(4, 5, 6, 7, 8)); // $ExpectType Observable<number>
26+
});
27+
28+
it('should infer type for 6 parameter', () => {
29+
const a = of(1, 2, 3).pipe(endWith(4, 5, 6, 7, 8, 9)); // $ExpectType Observable<number>
30+
});
31+
32+
it('should infer type for rest parameters', () => {
33+
const a = of(1, 2, 3).pipe(endWith(4, 5, 6, 7, 8, 9, 10)); // $ExpectType Observable<number>
34+
});
35+
36+
it('should accept empty parameter', () => {
37+
const a = of(1, 2, 3).pipe(endWith()); // $ExpectType Observable<number>
38+
});
39+
40+
it('should enforce type', () => {
41+
const a = of(1, 2, 3).pipe(endWith('4')); // $ExpectError
42+
});

0 commit comments

Comments
 (0)