]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/videos.ts
Add runner server tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / videos.ts
index 5ff51d1ff46f8055ae054669bf88d448fb2df948..572ca8997507791bdfd6dfb60dd3b9f8b942c41f 100644 (file)
@@ -1,11 +1,9 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
-import { omit } from 'lodash'
+import { expect } from 'chai'
 import { join } from 'path'
 import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared'
-import { randomInt, root } from '@shared/core-utils'
+import { omit, randomInt, root } from '@shared/core-utils'
 import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'
 import {
   cleanupTests,
@@ -18,8 +16,6 @@ import {
   setAccessTokensToServers
 } from '@shared/server-commands'
 
-const expect = chai.expect
-
 describe('Test videos API validator', function () {
   const path = '/api/v1/videos/'
   let server: PeerTubeServer
@@ -205,7 +201,7 @@ describe('Test videos API validator', function () {
         support: 'my super support text',
         tags: [ 'tag1', 'tag2' ],
         privacy: VideoPrivacy.PUBLIC,
-        channelId: channelId,
+        channelId,
         originallyPublishedAt: new Date().toISOString()
       }
     })
@@ -219,7 +215,7 @@ describe('Test videos API validator', function () {
       })
 
       it('Should fail without name', async function () {
-        const fields = omit(baseCorrectParams, 'name')
+        const fields = omit(baseCorrectParams, [ 'name' ])
         const attaches = baseCorrectAttaches
 
         await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
@@ -268,7 +264,7 @@ describe('Test videos API validator', function () {
       })
 
       it('Should fail without a channel', async function () {
-        const fields = omit(baseCorrectParams, 'channelId')
+        const fields = omit(baseCorrectParams, [ 'channelId' ])
         const attaches = baseCorrectAttaches
 
         await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)