Skip to content

Commit

Permalink
test(dtslint): add DOM fromEvent dtslint test (ReactiveX#4093)
Browse files Browse the repository at this point in the history
  • Loading branch information
Deddy Kosasih committed Aug 2, 2019
1 parent 36e2e8b commit 2307864
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec-dtslint/observables/fromEvent-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ const nodeStyleEventEmitter: NodeStyleEventEmitter = {
removeListener: (eventName, handler) => nodeStyleEventEmitter
};

const div: HTMLDivElement = new HTMLDivElement();

it('should infer correctly with HasEventTargetAddRemove event type', () => {
const a = fromEvent(hasEventTargetAddRemove, 'foo'); // $ExpectType Observable<string>
});

it('should infer correctly with NodeStyleEventEmitter event type', () => {
const a = fromEvent(document, 'foo'); // $ExpectType Observable<Event>
});

it('should infer correctly DOM event', () => {
const a = fromEvent(div, 'click'); // $ExpectType Observable<Event>
});

0 comments on commit 2307864

Please sign in to comment.