Skip to content

Commit

Permalink
test(fromEvent): add failing expectation
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Mar 6, 2018
1 parent 1e4ca05 commit 35aba2b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec/observables/fromEvent-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,17 @@ describe('fromEvent', () => {
});
});

it('should pass through options to addEventListener', () => {
let actualOptions;
it('should pass through options to addEventListener and removeEventListener', () => {
let onOptions;
let offOptions;
const expectedOptions = { capture: true, passive: true };

const obj = {
addEventListener: (a: string, b: EventListenerOrEventListenerObject, c?: any) => {
actualOptions = c;
onOptions = c;
},
removeEventListener: (a: string, b: EventListenerOrEventListenerObject, c?: any) => {
//noop
offOptions = c;
}
};

Expand All @@ -152,7 +153,8 @@ describe('fromEvent', () => {

subscription.unsubscribe();

expect(actualOptions).to.equal(expectedOptions);
expect(onOptions).to.equal(expectedOptions);
expect(offOptions).to.equal(expectedOptions);
});

it('should pass through events that occur', (done: MochaDone) => {
Expand Down

0 comments on commit 35aba2b

Please sign in to comment.