Skip to content

Commit

Permalink
Removing tests that don't make any sense (#3013)
Browse files Browse the repository at this point in the history
* test(partition): remove nonsense test

Test wasn't testing anything, it was passing the partition function
itself to the expect(), which doesn't really do anything of value.

* test(repeat): remove nonsense tests

These tests were really testing the rethrowing capability of Observable, as triggered when the scheduler was flushed. The call directly above the flush to `repeat` does nothing but create a new observable that is never subscribed to
  • Loading branch information
benlesh authored Oct 30, 2017
1 parent 1bd0a58 commit abf1627
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
5 changes: 0 additions & 5 deletions spec/operators/partition-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,6 @@ describe('Observable.prototype.partition', () => {
expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]);
});

it('should throw without predicate', () => {
const e1 = hot('--a-b---a------d----');
expect(e1.partition).to.throw();
});

it('should accept thisArg', () => {
const thisArg = {};

Expand Down
48 changes: 0 additions & 48 deletions spec/operators/repeat-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,54 +216,6 @@ describe('Observable.prototype.repeat', () => {
expectSubscriptions(e1.subscriptions).toBe(e1subs);
});

it('should terminate repeat and throw if source subscription to _next throws', () => {
const e1 = Observable.of<number>(1, 2, rxTestScheduler);
e1.subscribe(() => { throw new Error('error'); });

expect(() => {
e1.repeat(3);
rxTestScheduler.flush();
}).to.throw();
});

it('should terminate repeat and throw if source subscription to _complete throws', () => {
const e1 = Observable.of<number>(1, 2, rxTestScheduler);
e1.subscribe(() => {
//noop
}, () => {
//noop
}, () => { throw new Error('error'); });

expect(() => {
e1.repeat(3);
rxTestScheduler.flush();
}).to.throw();
});

it('should terminate repeat and throw if source subscription to _next throws when repeating infinitely', () => {
const e1 = Observable.of<number>(1, 2, rxTestScheduler);
e1.subscribe(() => { throw new Error('error'); });

expect(() => {
e1.repeat();
rxTestScheduler.flush();
}).to.throw();
});

it('should terminate repeat and throw if source subscription to _complete throws when repeating infinitely', () => {
const e1 = Observable.of<number>(1, 2, rxTestScheduler);
e1.subscribe(() => {
//noop
}, () => {
//noop
}, () => { throw new Error('error'); });

expect(() => {
e1.repeat();
rxTestScheduler.flush();
}).to.throw();
});

it('should raise error after first emit succeed', () => {
let repeated = false;

Expand Down

0 comments on commit abf1627

Please sign in to comment.