X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Futils%2Fvideos.ts;h=2a9a236ca50259f9b550ba4a21680cb04cb601e0;hb=14d3270f363245d2c83fcc2ac109e39743b5627e;hp=7f8bd39c094d2be5b61372fc3a3d80afc98f6228;hpb=40298b02546e8225dd21bf6048fe7f224aefc32a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/utils/videos.ts b/server/tests/utils/videos.ts index 7f8bd39c0..2a9a236ca 100644 --- a/server/tests/utils/videos.ts +++ b/server/tests/utils/videos.ts @@ -196,14 +196,14 @@ function uploadVideo (url: string, accessToken: string, videoAttributesArg: Vide req.field('tags[' + i + ']', attributes.tags[i]) } - let filepath = '' + let filePath = '' if (isAbsolute(attributes.fixture)) { - filepath = attributes.fixture + filePath = attributes.fixture } else { - filepath = join(__dirname, '..', 'api', 'fixtures', attributes.fixture) + filePath = join(__dirname, '..', 'api', 'fixtures', attributes.fixture) } - return req.attach('videofile', filepath) + return req.attach('videofile', filePath) .expect(specialStatus) } @@ -238,9 +238,9 @@ function rateVideo (url: string, accessToken: string, id: number, rating: string .expect(specialStatus) } -function parseTorrentVideo (server: ServerInfo, videoUUID: string, resolutionLabel: string) { +function parseTorrentVideo (server: ServerInfo, videoUUID: string, resolution: number) { return new Promise((res, rej) => { - const torrentName = videoUUID + '-' + resolutionLabel + '.torrent' + const torrentName = videoUUID + '-' + resolution + '.torrent' const torrentPath = join(__dirname, '..', '..', '..', 'test' + server.serverNumber, 'torrents', torrentName) readFile(torrentPath, (err, data) => { if (err) return rej(err)