From 329619b3453479f76c049816b7403b86e9d45cb5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 5 Jul 2021 16:37:50 +0200 Subject: Introduce CLI command --- server/tests/cli/print-transcode-command.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server/tests/cli/print-transcode-command.ts') diff --git a/server/tests/cli/print-transcode-command.ts b/server/tests/cli/print-transcode-command.ts index 2d7255db7..3a7969e68 100644 --- a/server/tests/cli/print-transcode-command.ts +++ b/server/tests/cli/print-transcode-command.ts @@ -2,14 +2,15 @@ import 'mocha' import * as chai from 'chai' -import { execCLI } from '../../../shared/extra-utils' +import { getVideoFileBitrate, getVideoFileFPS } from '@server/helpers/ffprobe-utils' +import { CLICommand } from '@shared/extra-utils' import { getTargetBitrate, VideoResolution } from '../../../shared/models/videos' import { VIDEO_TRANSCODING_FPS } from '../../initializers/constants' -import { getVideoFileBitrate, getVideoFileFPS } from '@server/helpers/ffprobe-utils' const expect = chai.expect describe('Test create transcoding jobs', function () { + it('Should print the correct command for each resolution', async function () { const fixturePath = 'server/tests/fixtures/video_short.webm' const fps = await getVideoFileFPS(fixturePath) @@ -19,7 +20,7 @@ describe('Test create transcoding jobs', function () { VideoResolution.H_720P, VideoResolution.H_1080P ]) { - const command = await execCLI(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`) + const command = await CLICommand.exec(`npm run print-transcode-command -- ${fixturePath} -r ${resolution}`) const targetBitrate = Math.min(getTargetBitrate(resolution, fps, VIDEO_TRANSCODING_FPS), bitrate) expect(command).to.includes(`-vf scale=w=-2:h=${resolution}`) -- cgit v1.2.3