aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/shared/live.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/shared/live.ts')
-rw-r--r--server/tests/shared/live.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tests/shared/live.ts b/server/tests/shared/live.ts
index 72e3e27f6..6ee4899b0 100644
--- a/server/tests/shared/live.ts
+++ b/server/tests/shared/live.ts
@@ -5,11 +5,11 @@ import { pathExists, readdir } from 'fs-extra'
5import { join } from 'path' 5import { join } from 'path'
6import { PeerTubeServer } from '@shared/server-commands' 6import { PeerTubeServer } from '@shared/server-commands'
7 7
8async function checkLiveCleanupAfterSave (server: PeerTubeServer, videoUUID: string, resolutions: number[] = []) { 8async function checkLiveCleanup (server: PeerTubeServer, videoUUID: string, savedResolutions: number[] = []) {
9 const basePath = server.servers.buildDirectory('streaming-playlists') 9 const basePath = server.servers.buildDirectory('streaming-playlists')
10 const hlsPath = join(basePath, 'hls', videoUUID) 10 const hlsPath = join(basePath, 'hls', videoUUID)
11 11
12 if (resolutions.length === 0) { 12 if (savedResolutions.length === 0) {
13 const result = await pathExists(hlsPath) 13 const result = await pathExists(hlsPath)
14 expect(result).to.be.false 14 expect(result).to.be.false
15 15
@@ -19,9 +19,9 @@ async function checkLiveCleanupAfterSave (server: PeerTubeServer, videoUUID: str
19 const files = await readdir(hlsPath) 19 const files = await readdir(hlsPath)
20 20
21 // fragmented file and playlist per resolution + master playlist + segments sha256 json file 21 // fragmented file and playlist per resolution + master playlist + segments sha256 json file
22 expect(files).to.have.lengthOf(resolutions.length * 2 + 2) 22 expect(files).to.have.lengthOf(savedResolutions.length * 2 + 2)
23 23
24 for (const resolution of resolutions) { 24 for (const resolution of savedResolutions) {
25 const fragmentedFile = files.find(f => f.endsWith(`-${resolution}-fragmented.mp4`)) 25 const fragmentedFile = files.find(f => f.endsWith(`-${resolution}-fragmented.mp4`))
26 expect(fragmentedFile).to.exist 26 expect(fragmentedFile).to.exist
27 27
@@ -37,5 +37,5 @@ async function checkLiveCleanupAfterSave (server: PeerTubeServer, videoUUID: str
37} 37}
38 38
39export { 39export {
40 checkLiveCleanupAfterSave 40 checkLiveCleanup
41} 41}