Skip to content

Commit

Permalink
test(remember): add test for rememember()
Browse files Browse the repository at this point in the history
Add a simple test that ensures values the last value is played back.
  • Loading branch information
TylorS committed Feb 29, 2016
1 parent de9f002 commit 9d15567
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/operator/remember.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import xs from '../../src/index';
import {emptyObserver} from '../../src/utils/emptyObserver';
import * as assert from 'assert';

describe.only('Stream.prototype.remember', () => {
it('should replay the last event to a new observer', (done) => {
const stream = xs.interval(1).take(6).remember();

stream.subscribe(emptyObserver);

setTimeout(() => {
stream.subscribe({
next(value) {
assert.strictEqual(value, 5);
},
error: done.fail,
end: () => done(),
});
}, 15);
});
});

0 comments on commit 9d15567

Please sign in to comment.