Skip to content

Commit

Permalink
adding tests for #224
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Jul 23, 2023
1 parent 089898c commit ab0c7c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/ops/take/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@ export default () => {
const res = i.next() && i.next() && i.next();
expect(res).to.eql({value: undefined, done: true});
});
it('must not extract more values than requested', () => {
const i = input[Symbol.iterator]();
const nextValues = (n: number) => [...pipe(i, take(n))];
expect(nextValues(2)).to.eql([10, 20]);
expect(nextValues(2)).to.eql([30, 40]);
expect(nextValues(2)).to.eql([50]);
});
};

0 comments on commit ab0c7c7

Please sign in to comment.