|
| 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