Fix live mode (#310)

* add failing test

* paused -> live now possible
This commit is contained in:
Justin Halsall
2020-08-27 15:33:12 +02:00
committed by GitHub
parent 772c0e021a
commit e717cda658
2 changed files with 16 additions and 0 deletions

View File

@@ -131,4 +131,16 @@ describe('replayer', function (this: ISuite) {
expect(currentTime).to.equal(2500);
expect(currentState).to.equal('paused');
});
it('can stream events in live mode', async () => {
const status = await this.page.evaluate(`
const { Replayer } = rrweb;
const replayer = new Replayer(events, {
liveMode: true
});
replayer.startLive();
replayer.service.state.value;
`);
expect(status).to.equal('live');
})
});