From 89d241a79c262b9775c233b73cff080043ebb5e6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 09:04:35 +0200 Subject: Shorter server command names --- server/tests/cli/create-transcoding-job.ts | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'server/tests/cli/create-transcoding-job.ts') diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts index f629306e6..c9bbab802 100644 --- a/server/tests/cli/create-transcoding-job.ts +++ b/server/tests/cli/create-transcoding-job.ts @@ -42,12 +42,12 @@ describe('Test create transcoding jobs', function () { servers = await flushAndRunMultipleServers(2) await setAccessTokensToServers(servers) - await servers[0].configCommand.updateCustomSubConfig({ newConfig: config }) + await servers[0].config.updateCustomSubConfig({ newConfig: config }) await doubleFollow(servers[0], servers[1]) for (let i = 1; i <= 5; i++) { - const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'video' + i } }) + const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video' + i } }) videosUUID.push(uuid) } @@ -58,11 +58,11 @@ describe('Test create transcoding jobs', function () { this.timeout(30000) for (const server of servers) { - const { data } = await server.videosCommand.list() + const { data } = await server.videos.list() expect(data).to.have.lengthOf(videosUUID.length) for (const video of data) { - const videoDetail = await server.videosCommand.get({ id: video.uuid }) + const videoDetail = await server.videos.get({ id: video.uuid }) expect(videoDetail.files).to.have.lengthOf(1) expect(videoDetail.streamingPlaylists).to.have.lengthOf(0) } @@ -72,16 +72,16 @@ describe('Test create transcoding jobs', function () { it('Should run a transcoding job on video 2', async function () { this.timeout(60000) - await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[1]}`) + await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[1]}`) await waitJobs(servers) for (const server of servers) { - const { data } = await server.videosCommand.list() + const { data } = await server.videos.list() let infoHashes: { [id: number]: string } for (const video of data) { - const videoDetail = await server.videosCommand.get({ id: video.uuid }) + const videoDetail = await server.videos.get({ id: video.uuid }) if (video.uuid === videosUUID[1]) { expect(videoDetail.files).to.have.lengthOf(4) @@ -110,15 +110,15 @@ describe('Test create transcoding jobs', function () { it('Should run a transcoding job on video 1 with resolution', async function () { this.timeout(60000) - await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[0]} -r 480`) + await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[0]} -r 480`) await waitJobs(servers) for (const server of servers) { - const { data } = await server.videosCommand.list() + const { data } = await server.videos.list() expect(data).to.have.lengthOf(videosUUID.length) - const videoDetails = await server.videosCommand.get({ id: videosUUID[0] }) + const videoDetails = await server.videos.get({ id: videosUUID[0] }) expect(videoDetails.files).to.have.lengthOf(2) expect(videoDetails.files[0].resolution.id).to.equal(720) @@ -131,12 +131,12 @@ describe('Test create transcoding jobs', function () { it('Should generate an HLS resolution', async function () { this.timeout(120000) - await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) + await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) await waitJobs(servers) for (const server of servers) { - const videoDetails = await server.videosCommand.get({ id: videosUUID[2] }) + const videoDetails = await server.videos.get({ id: videosUUID[2] }) expect(videoDetails.files).to.have.lengthOf(1) expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) @@ -150,12 +150,12 @@ describe('Test create transcoding jobs', function () { it('Should not duplicate an HLS resolution', async function () { this.timeout(120000) - await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) + await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) await waitJobs(servers) for (const server of servers) { - const videoDetails = await server.videosCommand.get({ id: videosUUID[2] }) + const videoDetails = await server.videos.get({ id: videosUUID[2] }) const files = videoDetails.streamingPlaylists[0].files expect(files).to.have.lengthOf(1) @@ -166,12 +166,12 @@ describe('Test create transcoding jobs', function () { it('Should generate all HLS resolutions', async function () { this.timeout(120000) - await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[3]} --generate-hls`) + await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[3]} --generate-hls`) await waitJobs(servers) for (const server of servers) { - const videoDetails = await server.videosCommand.get({ id: videosUUID[3] }) + const videoDetails = await server.videos.get({ id: videosUUID[3] }) expect(videoDetails.files).to.have.lengthOf(1) expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) @@ -185,14 +185,14 @@ describe('Test create transcoding jobs', function () { this.timeout(120000) config.transcoding.hls.enabled = true - await servers[0].configCommand.updateCustomSubConfig({ newConfig: config }) + await servers[0].config.updateCustomSubConfig({ newConfig: config }) - await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[4]}`) + await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[4]}`) await waitJobs(servers) for (const server of servers) { - const videoDetails = await server.videosCommand.get({ id: videosUUID[4] }) + const videoDetails = await server.videos.get({ id: videosUUID[4] }) expect(videoDetails.files).to.have.lengthOf(4) expect(videoDetails.streamingPlaylists).to.have.lengthOf(1) -- cgit v1.2.3