Skip to content

Commit

Permalink
test(dtslint): add auditTime (#4171)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver authored and cartant committed Sep 25, 2018
1 parent be35fa3 commit 028adbd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec-dtslint/operators/auditTime-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { of, asyncScheduler } from 'rxjs';
import { auditTime } from 'rxjs/operators';

it('should infer correctly', () => {
const o = of('a', 'b', 'c').pipe(auditTime(47)); // $ExpectType Observable<string>
});

it('should support a scheduler', () => {
const o = of('a', 'b', 'c').pipe(auditTime(47, asyncScheduler)); // $ExpectType Observable<string>
});

it('should enforce types', () => {
const o = of('a', 'b', 'c').pipe(auditTime()); // $ExpectError
const p = of('a', 'b', 'c').pipe(auditTime('47')); // $ExpectError
const q = of('a', 'b', 'c').pipe(auditTime(47, 'foo')); // $ExpectError
});

0 comments on commit 028adbd

Please sign in to comment.