Skip to content

Commit

Permalink
test(dropRepeats): check that it completes
Browse files Browse the repository at this point in the history
PR #246
  • Loading branch information
graingert authored and staltz committed May 18, 2018
1 parent 6e43aa5 commit 328fbad
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/extra/dropRepeats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ describe('dropRepeats (extra)', () => {
},
});
});

it('should complete when input completes', (done: any) => {
const stream = xs.of(1).compose(dropRepeats());
const expected = [1];

stream.addListener({
next: (x: number) => {
assert.equal(x, expected.shift());
},
error: (err: any) => done(err),
complete: () => {
assert.equal(expected.length, 0);
done();
},
});
});

it('should drop consecutive \'duplicate\' strings, with a custom isEqual', (done: any) => {
const stream = xs.of('a', 'b', 'a', 'A', 'B', 'b')
Expand Down

0 comments on commit 328fbad

Please sign in to comment.