Skip to content

Commit

Permalink
fix: support empty subscription marbles (#5502)
Browse files Browse the repository at this point in the history
* test: add failing subscription marble tests

* fix: support empty subscription marbles

Closes #5499
  • Loading branch information
cartant authored Jun 22, 2020
1 parent edde63b commit e65696e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions spec/schedulers/TestScheduler-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@ describe('TestScheduler', () => {
expectSubscriptions(source.subscriptions).toBe(subs);
source.subscribe();
});

it('should support empty subscription marbles', () => {
const source = cold('---a---b-|');
const subs = '----------';
expectSubscriptions(source.subscriptions).toBe(subs);
});

it('should support empty subscription marbles within arrays', () => {
const source = cold('---a---b-|');
const subs = ['----------'];
expectSubscriptions(source.subscriptions).toBe(subs);
});
});

describe('end-to-end helper tests', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/testing/TestScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class TestScheduler extends VirtualTimeScheduler {
flushTest.ready = true;
flushTest.expected = marblesArray.map(marbles =>
TestScheduler.parseMarblesAsSubscriptions(marbles, runMode)
);
).filter(marbles => marbles.subscribedFrame !== Infinity);
}
};
}
Expand Down

0 comments on commit e65696e

Please sign in to comment.