Skip to content

Commit

Permalink
test(dtslint): add bufferCount (#4194)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver authored and cartant committed Sep 27, 2018
1 parent 8127f0b commit 6a2b524
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec-dtslint/operators/bufferCount-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { of } from 'rxjs';
import { bufferCount } from 'rxjs/operators';

it('should infer correctly', () => {
const o = of(1, 2, 3).pipe(bufferCount(1)); // $ExpectType Observable<number[]>
const p = of(1, 2, 3).pipe(bufferCount(1, 7)); // $ExpectType Observable<number[]>
});

it('should enforce types', () => {
const o = of(1, 2, 3).pipe(bufferCount()); // $ExpectError
});

it('should enforce type of bufferSize', () => {
const o = of(1, 2, 3).pipe(bufferCount('7')); // $ExpectError
});

it('should enforce type of startBufferEvery', () => {
const o = of(1, 2, 3).pipe(bufferCount(1, '7')); // $ExpectError
});

0 comments on commit 6a2b524

Please sign in to comment.