-
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
Showing
1 changed file
with
30 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,30 @@ | ||
import { of, asyncScheduler } from 'rxjs'; | ||
import { shareReplay } from 'rxjs/operators'; | ||
|
||
it('should accept an individual bufferSize parameter', () => { | ||
const o = of(1, 2, 3).pipe(shareReplay(1)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should accept individual bufferSize and windowTime parameters', () => { | ||
const o = of(1, 2, 3).pipe(shareReplay(1, 2)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should accept individual bufferSize, windowTime and scheduler parameters', () => { | ||
const o3 = of(1, 2, 3).pipe(shareReplay(1, 2, asyncScheduler)); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should accept a bufferSize config parameter', () => { | ||
const o = of(1, 2, 3).pipe(shareReplay({ bufferSize: 1, refCount: true })); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should accept bufferSize and windowTime config parameters', () => { | ||
const o = of(1, 2, 3).pipe(shareReplay({ bufferSize: 1, windowTime: 2, refCount: true })); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should accept bufferSize, windowTime and scheduler config parameters', () => { | ||
const o = of(1, 2, 3).pipe(shareReplay({ bufferSize: 1, windowTime: 2, scheduler: asyncScheduler, refCount: true })); // $ExpectType Observable<number> | ||
}); | ||
|
||
it('should require a refCount config parameter', () => { | ||
const o = of(1, 2, 3).pipe(shareReplay({ bufferSize: 1 })); // $ExpectError | ||
}); |