-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
229f06a
commit 4e73844
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { of, asyncScheduler } from 'rxjs'; | ||
import { startWith } from 'rxjs/operators'; | ||
import { TestScheduler } from 'rxjs/testing'; | ||
|
||
declare const rxTestScheduler: TestScheduler; | ||
|
||
it('should infer correctly with one value', () => { | ||
const o = of(1, 2, 3).pipe(startWith(4)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should infer correctly with multiple values', () => { | ||
const o = of(1, 2, 3).pipe(startWith(4, 5, 6)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should infer correctly with no value', () => { | ||
const o = of(1, 2, 3).pipe(startWith()); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should infer correctly with a value and a scheduler', () => { | ||
const o = of(1, 2, 3).pipe(startWith(5, asyncScheduler)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should infer correctly with only a scheduler', () => { | ||
const o = of(1, 2, 3).pipe(startWith(asyncScheduler)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should enforce types with one value', () => { | ||
const o = of(1, 2, 3).pipe(startWith('foo')); // $ExpectError | ||
}); | ||
|
||
it('should enforce types with multiple value', () => { | ||
const o = of(1, 2, 3).pipe(startWith(4, 'foo')); // $ExpectError | ||
}); |