From e5a516e7029db1f07d56924049f4810110b01cfe Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Nov 2020 13:47:43 +0100 Subject: More robust live test --- server/tests/api/live/live.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index f99e7ad46..843943bba 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts @@ -583,8 +583,8 @@ describe('Test live', function () { await waitJobs(servers) for (const stateChanges of [ localStateChanges, remoteStateChanges ]) { - expect(stateChanges).to.have.lengthOf(1) - expect(stateChanges[0]).to.equal(VideoState.PUBLISHED) + expect(stateChanges).to.have.length.at.least(1) + expect(stateChanges[stateChanges.length - 1]).to.equal(VideoState.PUBLISHED) } await stopFfmpeg(command) @@ -593,8 +593,8 @@ describe('Test live', function () { await waitJobs(servers) for (const stateChanges of [ localStateChanges, remoteStateChanges ]) { - expect(stateChanges).to.have.lengthOf(2) - expect(stateChanges[1]).to.equal(VideoState.LIVE_ENDED) + expect(stateChanges).to.have.length.at.least(2) + expect(stateChanges[stateChanges.length - 1]).to.equal(VideoState.LIVE_ENDED) } }) -- cgit v1.2.3