Skip to content

Commit

Permalink
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions spec-dtslint/observables/timer-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { timer, animationFrameScheduler } from 'rxjs';

it('should infer correctly with 1 parameter of number type', () => {
const a = timer(1); // $ExpectType Observable<number>
});

it('should infer correctly with 1 parameter of date type', () => {
const a = timer((new Date())); // $ExpectType Observable<number>
});

it('should not support string parameter', () => {
const a = timer('a'); // $ExpectError
});

it('should infer correctly with 2 parameters', () => {
const a = timer(1, 2); // $ExpectType Observable<number>
});

it('should support scheduler as second parameter', () => {
const a = timer(1, animationFrameScheduler); // $ExpectType Observable<number>
});

it('should support scheduler as third parameter', () => {
const a = timer(1, 2, animationFrameScheduler); // $ExpectType Observable<number>
});

0 comments on commit be4f419

Please sign in to comment.