Skip to content

Commit

Permalink
test(dtslint): add shareReplay
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Aug 29, 2018
1 parent 3b4b01f commit 318e2bf
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions spec-dtslint/operators/shareReplay-spec.ts
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
});

0 comments on commit 318e2bf

Please sign in to comment.