Skip to content

Commit

Permalink
test(throttleTime): should handle busy producer with options '{ leadi…
Browse files Browse the repository at this point in the history
…ng: true, trailing: true }'
  • Loading branch information
devel112 committed Jan 26, 2019
1 parent 0954f9f commit 68245a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/operators/throttleTime-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ describe('throttleTime operator', () => {
expectObservable(result).toBe(expected);
expectSubscriptions(e1.subscriptions).toBe(e1subs);
});
asDiagram('throttleTime(fn, { leading: true, trailing: true })')('should handle a busy producer emitting a regular repeating sequence', () => {
const e1 = hot('abcdabcdabcdabcdabcd|');
const subs = '^ !';
const t = time('----| ');
const expected = 'a---a---a---a---a---(d|';

expectObservable(e1.pipe(throttleTime(t, rxTestScheduler, { leading: true, trailing: true }))).toBe(expected);
expectSubscriptions(e1.subscriptions).toBe(subs);
});
});

describe('throttleTime(fn, { leading: false, trailing: true })', () => {
Expand Down

0 comments on commit 68245a0

Please sign in to comment.