diff options
Diffstat (limited to 'server/tests/helpers')
-rw-r--r-- | server/tests/helpers/comment-model.ts | 2 | ||||
-rw-r--r-- | server/tests/helpers/core-utils.ts | 4 | ||||
-rw-r--r-- | server/tests/helpers/image.ts | 2 | ||||
-rw-r--r-- | server/tests/helpers/request.ts | 10 |
4 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/helpers/comment-model.ts b/server/tests/helpers/comment-model.ts index 4c51b7000..31dc6ec72 100644 --- a/server/tests/helpers/comment-model.ts +++ b/server/tests/helpers/comment-model.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { VideoCommentModel } from '../../models/video/video-comment' | 5 | import { VideoCommentModel } from '../../models/video/video-comment' |
6 | 6 | ||
7 | const expect = chai.expect | 7 | const expect = chai.expect |
diff --git a/server/tests/helpers/core-utils.ts b/server/tests/helpers/core-utils.ts index c028b316d..d5cac51a3 100644 --- a/server/tests/helpers/core-utils.ts +++ b/server/tests/helpers/core-utils.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { snakeCase } from 'lodash' | 5 | import { snakeCase } from 'lodash' |
6 | import { objectConverter, parseBytes } from '../../helpers/core-utils' | ||
7 | import validator from 'validator' | 6 | import validator from 'validator' |
7 | import { objectConverter, parseBytes } from '../../helpers/core-utils' | ||
8 | 8 | ||
9 | const expect = chai.expect | 9 | const expect = chai.expect |
10 | 10 | ||
diff --git a/server/tests/helpers/image.ts b/server/tests/helpers/image.ts index 54911697f..9fe9aa4cb 100644 --- a/server/tests/helpers/image.ts +++ b/server/tests/helpers/image.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | ||
4 | import { readFile, remove } from 'fs-extra' | 5 | import { readFile, remove } from 'fs-extra' |
5 | import { join } from 'path' | 6 | import { join } from 'path' |
6 | import { processImage } from '../../../server/helpers/image-utils' | 7 | import { processImage } from '../../../server/helpers/image-utils' |
7 | import { buildAbsoluteFixturePath, root } from '../../../shared/extra-utils' | 8 | import { buildAbsoluteFixturePath, root } from '../../../shared/extra-utils' |
8 | import { expect } from 'chai' | ||
9 | 9 | ||
10 | async function checkBuffers (path1: string, path2: string, equals: boolean) { | 10 | async function checkBuffers (path1: string, path2: string, equals: boolean) { |
11 | const [ buf1, buf2 ] = await Promise.all([ | 11 | const [ buf1, buf2 ] = await Promise.all([ |
diff --git a/server/tests/helpers/request.ts b/server/tests/helpers/request.ts index 5e77f129e..7f7873df3 100644 --- a/server/tests/helpers/request.ts +++ b/server/tests/helpers/request.ts | |||
@@ -4,7 +4,7 @@ import 'mocha' | |||
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { pathExists, remove } from 'fs-extra' | 5 | import { pathExists, remove } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { get4KFileUrl, root, wait } from '../../../shared/extra-utils' | 7 | import { FIXTURE_URLS, root, wait } from '../../../shared/extra-utils' |
8 | import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests' | 8 | import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests' |
9 | 9 | ||
10 | describe('Request helpers', function () { | 10 | describe('Request helpers', function () { |
@@ -13,7 +13,7 @@ describe('Request helpers', function () { | |||
13 | 13 | ||
14 | it('Should throw an error when the bytes limit is exceeded for request', async function () { | 14 | it('Should throw an error when the bytes limit is exceeded for request', async function () { |
15 | try { | 15 | try { |
16 | await doRequest(get4KFileUrl(), { bodyKBLimit: 3 }) | 16 | await doRequest(FIXTURE_URLS.video4K, { bodyKBLimit: 3 }) |
17 | } catch { | 17 | } catch { |
18 | return | 18 | return |
19 | } | 19 | } |
@@ -23,7 +23,7 @@ describe('Request helpers', function () { | |||
23 | 23 | ||
24 | it('Should throw an error when the bytes limit is exceeded for request and save file', async function () { | 24 | it('Should throw an error when the bytes limit is exceeded for request and save file', async function () { |
25 | try { | 25 | try { |
26 | await doRequestAndSaveToFile(get4KFileUrl(), destPath1, { bodyKBLimit: 3 }) | 26 | await doRequestAndSaveToFile(FIXTURE_URLS.video4K, destPath1, { bodyKBLimit: 3 }) |
27 | } catch { | 27 | } catch { |
28 | 28 | ||
29 | await wait(500) | 29 | await wait(500) |
@@ -35,8 +35,8 @@ describe('Request helpers', function () { | |||
35 | }) | 35 | }) |
36 | 36 | ||
37 | it('Should succeed if the file is below the limit', async function () { | 37 | it('Should succeed if the file is below the limit', async function () { |
38 | await doRequest(get4KFileUrl(), { bodyKBLimit: 5 }) | 38 | await doRequest(FIXTURE_URLS.video4K, { bodyKBLimit: 5 }) |
39 | await doRequestAndSaveToFile(get4KFileUrl(), destPath2, { bodyKBLimit: 5 }) | 39 | await doRequestAndSaveToFile(FIXTURE_URLS.video4K, destPath2, { bodyKBLimit: 5 }) |
40 | 40 | ||
41 | expect(await pathExists(destPath2)).to.be.true | 41 | expect(await pathExists(destPath2)).to.be.true |
42 | }) | 42 | }) |