]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/cli/create-import-video-file-job.ts
Introduce CLI command
[github/Chocobozzz/PeerTube.git] / server / tests / cli / create-import-video-file-job.ts
index 49758ff56cf64872c89e1d8778b45205058864f7..8a23a94decaf556242a59933e67a6ee8afff0b2f 100644 (file)
@@ -6,9 +6,7 @@ import { VideoFile } from '@shared/models/videos/video-file.model'
 import {
   cleanupTests,
   doubleFollow,
-  execCLI,
   flushAndRunMultipleServers,
-  getEnvCli,
   getVideo,
   getVideosList,
   ServerInfo,
@@ -57,8 +55,8 @@ describe('Test create import video jobs', function () {
   })
 
   it('Should run a import job on video 1 with a lower resolution', async function () {
-    const env = getEnvCli(servers[0])
-    await execCLI(`${env} npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short-480.webm`)
+    const command = `npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short-480.webm`
+    await servers[0].cliCommand.execWithEnv(command)
 
     await waitJobs(servers)
 
@@ -77,8 +75,8 @@ describe('Test create import video jobs', function () {
   })
 
   it('Should run a import job on video 2 with the same resolution and a different extension', async function () {
-    const env = getEnvCli(servers[1])
-    await execCLI(`${env} npm run create-import-video-file-job -- -v ${video2UUID} -i server/tests/fixtures/video_short.ogv`)
+    const command = `npm run create-import-video-file-job -- -v ${video2UUID} -i server/tests/fixtures/video_short.ogv`
+    await servers[1].cliCommand.execWithEnv(command)
 
     await waitJobs(servers)
 
@@ -99,8 +97,8 @@ describe('Test create import video jobs', function () {
   })
 
   it('Should run a import job on video 2 with the same resolution and the same extension', async function () {
-    const env = getEnvCli(servers[0])
-    await execCLI(`${env} npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short2.webm`)
+    const command = `npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short2.webm`
+    await servers[0].cliCommand.execWithEnv(command)
 
     await waitJobs(servers)