aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/shared/checks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/shared/checks.ts')
-rw-r--r--server/tests/shared/checks.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/tests/shared/checks.ts b/server/tests/shared/checks.ts
index feaef37c6..90179c6ac 100644
--- a/server/tests/shared/checks.ts
+++ b/server/tests/shared/checks.ts
@@ -61,6 +61,16 @@ async function testImageSize (url: string, imageName: string, imageHTTPPath: str
61 expect(body.length).to.be.below(maxLength, 'the generated image is way larger than the recorded fixture') 61 expect(body.length).to.be.below(maxLength, 'the generated image is way larger than the recorded fixture')
62} 62}
63 63
64async function testImageGeneratedByFFmpeg (url: string, imageName: string, imageHTTPPath: string, extension = '.jpg') {
65 if (process.env.ENABLE_FFMPEG_THUMBNAIL_PIXEL_COMPARISON_TESTS !== 'true') {
66 console.log(
67 'Pixel comparison of image generated by ffmpeg is disabled. ' +
68 'You can enable it using `ENABLE_FFMPEG_THUMBNAIL_PIXEL_COMPARISON_TESTS=true env variable')
69 }
70
71 return testImage(url, imageName, imageHTTPPath, extension)
72}
73
64async function testImage (url: string, imageName: string, imageHTTPPath: string, extension = '.jpg') { 74async function testImage (url: string, imageName: string, imageHTTPPath: string, extension = '.jpg') {
65 const res = await makeGetRequest({ 75 const res = await makeGetRequest({
66 url, 76 url,
@@ -148,6 +158,7 @@ async function checkVideoDuration (server: PeerTubeServer, videoUUID: string, du
148 158
149export { 159export {
150 dateIsValid, 160 dateIsValid,
161 testImageGeneratedByFFmpeg,
151 testImageSize, 162 testImageSize,
152 testImage, 163 testImage,
153 expectLogDoesNotContain, 164 expectLogDoesNotContain,