X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Faudio-only.ts;h=053b29ca14322596d8bc3c4b9e3626650be1bdfd;hb=5a547f69d5dc5867e253f7721513479c754b4f15;hp=f5b6a26e58975b40fe1383a161ed197fb5ba831e;hpb=66a36740044242568ae7868842eb36a920b21544;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts index f5b6a26e5..053b29ca1 100644 --- a/server/tests/api/videos/audio-only.ts +++ b/server/tests/api/videos/audio-only.ts @@ -1,28 +1,21 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' import 'mocha' +import * as chai from 'chai' +import { join } from 'path' +import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' import { - checkDirectoryIsEmpty, - checkSegmentHash, - checkTmpIsEmpty, cleanupTests, doubleFollow, flushAndRunMultipleServers, - getPlaylist, - getVideo, makeGetRequest, makeRawRequest, - removeVideo, root, + getVideo, + root, ServerInfo, - setAccessTokensToServers, updateCustomSubConfig, - updateVideo, + setAccessTokensToServers, uploadVideo, - waitJobs, webtorrentAdd + waitJobs } from '../../../../shared/extra-utils' import { VideoDetails } from '../../../../shared/models/videos' -import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' -import { join } from 'path' -import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' -import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution, audio, getVideoFileSize } from '@server/helpers/ffmpeg-utils' const expect = chai.expect @@ -87,16 +80,16 @@ describe('Test audio only video transcoding', function () { it('0p transcoded video should not have video', async function () { const paths = [ - join(root(), 'test' + servers[ 0 ].internalServerNumber, 'videos', videoUUID + '-0.mp4'), - join(root(), 'test' + servers[ 0 ].internalServerNumber, 'streaming-playlists', 'hls', videoUUID, videoUUID + '-0-fragmented.mp4') + join(root(), 'test' + servers[0].internalServerNumber, 'videos', videoUUID + '-0.mp4'), + join(root(), 'test' + servers[0].internalServerNumber, 'streaming-playlists', 'hls', videoUUID, videoUUID + '-0-fragmented.mp4') ] for (const path of paths) { - const { audioStream } = await audio.get(path) - expect(audioStream[ 'codec_name' ]).to.be.equal('aac') - expect(audioStream[ 'bit_rate' ]).to.be.at.most(384 * 8000) + const { audioStream } = await getAudioStream(path) + expect(audioStream['codec_name']).to.be.equal('aac') + expect(audioStream['bit_rate']).to.be.at.most(384 * 8000) - const size = await getVideoFileSize(path) + const size = await getVideoStreamSize(path) expect(size.height).to.equal(0) expect(size.width).to.equal(0) }