Skip to content

Commit

Permalink
test(dtslint): add dtslint test for defer observable static function (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dkosasih authored and cartant committed Dec 27, 2018
1 parent 550bff9 commit 09a39d7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec-dtslint/observables/defer-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { of, defer } from 'rxjs';

it('should enforce function parameter', () => {
const a = defer(); // $ExpectError
});

it('should infer correctly with function return observable', () => {
const a = defer(() => of(1, 2, 3)); // $ExpectType Observable<number>
});

it('should infer correctly with function return promise', () => {
const a = defer(() => Promise.resolve(5)); // $ExpectType Observable<number>
});

0 comments on commit 09a39d7

Please sign in to comment.