From 6a2b524bc62cb1039123ecc45c7ccc65358d9eb1 Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Thu, 27 Sep 2018 13:29:26 +0200 Subject: [PATCH] test(dtslint): add bufferCount (#4194) --- spec-dtslint/operators/bufferCount-spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spec-dtslint/operators/bufferCount-spec.ts diff --git a/spec-dtslint/operators/bufferCount-spec.ts b/spec-dtslint/operators/bufferCount-spec.ts new file mode 100644 index 0000000000..54767a2a89 --- /dev/null +++ b/spec-dtslint/operators/bufferCount-spec.ts @@ -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 + const p = of(1, 2, 3).pipe(bufferCount(1, 7)); // $ExpectType Observable +}); + +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 +});