diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-14 16:52:22 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-06-15 08:21:12 +0200 |
commit | 3d470a530c4a48b2e4f4a9e7d4f223e14f32cea4 (patch) | |
tree | 7305399caecbf7380319bd08e21c933de88096dc /server/tests/api/check-params/video-imports.ts | |
parent | 79db409a41bd28fd2773626c9a93b5d326a38bc0 (diff) | |
download | PeerTube-3d470a530c4a48b2e4f4a9e7d4f223e14f32cea4.tar.gz PeerTube-3d470a530c4a48b2e4f4a9e7d4f223e14f32cea4.tar.zst PeerTube-3d470a530c4a48b2e4f4a9e7d4f223e14f32cea4.zip |
Faster ci using compiled ts files
Diffstat (limited to 'server/tests/api/check-params/video-imports.ts')
-rw-r--r-- | server/tests/api/check-params/video-imports.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index 6de6b40c8..a27b624d0 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts | |||
@@ -2,8 +2,9 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { join } from 'path' | 5 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' |
6 | import { | 6 | import { |
7 | buildAbsoluteFixturePath, | ||
7 | cleanupTests, | 8 | cleanupTests, |
8 | createUser, | 9 | createUser, |
9 | flushAndRunServer, | 10 | flushAndRunServer, |
@@ -22,9 +23,8 @@ import { | |||
22 | checkBadSortPagination, | 23 | checkBadSortPagination, |
23 | checkBadStartPagination | 24 | checkBadStartPagination |
24 | } from '../../../../shared/extra-utils/requests/check-api-params' | 25 | } from '../../../../shared/extra-utils/requests/check-api-params' |
25 | import { getMagnetURI, getGoodVideoUrl } from '../../../../shared/extra-utils/videos/video-imports' | 26 | import { getGoodVideoUrl, getMagnetURI } from '../../../../shared/extra-utils/videos/video-imports' |
26 | import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' | 27 | import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' |
27 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
28 | 28 | ||
29 | describe('Test video imports API validator', function () { | 29 | describe('Test video imports API validator', function () { |
30 | const path = '/api/v1/videos/imports' | 30 | const path = '/api/v1/videos/imports' |
@@ -201,7 +201,7 @@ describe('Test video imports API validator', function () { | |||
201 | it('Should fail with an incorrect thumbnail file', async function () { | 201 | it('Should fail with an incorrect thumbnail file', async function () { |
202 | const fields = baseCorrectParams | 202 | const fields = baseCorrectParams |
203 | const attaches = { | 203 | const attaches = { |
204 | thumbnailfile: join(__dirname, '..', '..', 'fixtures', 'video_short.mp4') | 204 | thumbnailfile: buildAbsoluteFixturePath('video_short.mp4') |
205 | } | 205 | } |
206 | 206 | ||
207 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) | 207 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) |
@@ -210,7 +210,7 @@ describe('Test video imports API validator', function () { | |||
210 | it('Should fail with a big thumbnail file', async function () { | 210 | it('Should fail with a big thumbnail file', async function () { |
211 | const fields = baseCorrectParams | 211 | const fields = baseCorrectParams |
212 | const attaches = { | 212 | const attaches = { |
213 | thumbnailfile: join(__dirname, '..', '..', 'fixtures', 'preview-big.png') | 213 | thumbnailfile: buildAbsoluteFixturePath('preview-big.png') |
214 | } | 214 | } |
215 | 215 | ||
216 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) | 216 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) |
@@ -219,7 +219,7 @@ describe('Test video imports API validator', function () { | |||
219 | it('Should fail with an incorrect preview file', async function () { | 219 | it('Should fail with an incorrect preview file', async function () { |
220 | const fields = baseCorrectParams | 220 | const fields = baseCorrectParams |
221 | const attaches = { | 221 | const attaches = { |
222 | previewfile: join(__dirname, '..', '..', 'fixtures', 'video_short.mp4') | 222 | previewfile: buildAbsoluteFixturePath('video_short.mp4') |
223 | } | 223 | } |
224 | 224 | ||
225 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) | 225 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) |
@@ -228,7 +228,7 @@ describe('Test video imports API validator', function () { | |||
228 | it('Should fail with a big preview file', async function () { | 228 | it('Should fail with a big preview file', async function () { |
229 | const fields = baseCorrectParams | 229 | const fields = baseCorrectParams |
230 | const attaches = { | 230 | const attaches = { |
231 | previewfile: join(__dirname, '..', '..', 'fixtures', 'preview-big.png') | 231 | previewfile: buildAbsoluteFixturePath('preview-big.png') |
232 | } | 232 | } |
233 | 233 | ||
234 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) | 234 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) |
@@ -237,7 +237,7 @@ describe('Test video imports API validator', function () { | |||
237 | it('Should fail with an invalid torrent file', async function () { | 237 | it('Should fail with an invalid torrent file', async function () { |
238 | const fields = omit(baseCorrectParams, 'targetUrl') | 238 | const fields = omit(baseCorrectParams, 'targetUrl') |
239 | const attaches = { | 239 | const attaches = { |
240 | torrentfile: join(__dirname, '..', '..', 'fixtures', 'avatar-big.png') | 240 | torrentfile: buildAbsoluteFixturePath('avatar-big.png') |
241 | } | 241 | } |
242 | 242 | ||
243 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) | 243 | await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) |
@@ -312,7 +312,7 @@ describe('Test video imports API validator', function () { | |||
312 | 312 | ||
313 | fields = omit(fields, 'magnetUri') | 313 | fields = omit(fields, 'magnetUri') |
314 | const attaches = { | 314 | const attaches = { |
315 | torrentfile: join(__dirname, '..', '..', 'fixtures', 'video-720p.torrent') | 315 | torrentfile: buildAbsoluteFixturePath('video-720p.torrent') |
316 | } | 316 | } |
317 | 317 | ||
318 | await makeUploadRequest({ | 318 | await makeUploadRequest({ |