diff options
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/utils.js | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js index 7c8698a0a..314269b5c 100644 --- a/server/tests/api/utils.js +++ b/server/tests/api/utils.js | |||
@@ -350,18 +350,25 @@ function searchVideoWithSort (url, search, sort, end) { | |||
350 | } | 350 | } |
351 | 351 | ||
352 | function testImage (url, videoName, imagePath, callback) { | 352 | function testImage (url, videoName, imagePath, callback) { |
353 | request(url) | 353 | // Don't test images if the node env is not set |
354 | .get(imagePath) | 354 | // Because we need a special ffmpeg version for this test |
355 | .expect(200) | 355 | if (process.env.NODE_TEST_IMAGE) { |
356 | .end(function (err, res) { | 356 | request(url) |
357 | if (err) return callback(err) | 357 | .get(imagePath) |
358 | 358 | .expect(200) | |
359 | fs.readFile(pathUtils.join(__dirname, 'fixtures', videoName + '.jpg'), function (err, data) { | 359 | .end(function (err, res) { |
360 | if (err) return callback(err) | 360 | if (err) return callback(err) |
361 | 361 | ||
362 | callback(null, data.equals(res.body)) | 362 | fs.readFile(pathUtils.join(__dirname, 'fixtures', videoName + '.jpg'), function (err, data) { |
363 | if (err) return callback(err) | ||
364 | |||
365 | callback(null, data.equals(res.body)) | ||
366 | }) | ||
363 | }) | 367 | }) |
364 | }) | 368 | } else { |
369 | console.log('Do not test images. Enable it by setting NODE_TEST_IMAGE env variable.') | ||
370 | callback(null, true) | ||
371 | } | ||
365 | } | 372 | } |
366 | 373 | ||
367 | function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) { | 374 | function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) { |