]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/video-imports.ts
Merge branch 'release/5.0.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / video-imports.ts
index 85382b261e5a04061936e65435a05b0d15cc46da..7f19b9ee9b1f84ae0d6e3c76298ba78d719150e1 100644 (file)
@@ -1,9 +1,7 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import { omit } from 'lodash'
 import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, FIXTURE_URLS } from '@server/tests/shared'
-import { buildAbsoluteFixturePath } from '@shared/core-utils'
+import { buildAbsoluteFixturePath, omit } from '@shared/core-utils'
 import { HttpStatusCode, VideoPrivacy } from '@shared/models'
 import {
   cleanupTests,
@@ -107,7 +105,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail without a target url', async function () {
-      const fields = omit(baseCorrectParams, 'targetUrl')
+      const fields = omit(baseCorrectParams, [ 'targetUrl' ])
       await makePostBodyRequest({
         url: server.url,
         path,
@@ -189,7 +187,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail without a channel', async function () {
-      const fields = omit(baseCorrectParams, 'channelId')
+      const fields = omit(baseCorrectParams, [ 'channelId' ])
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
     })
@@ -271,7 +269,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail with an invalid torrent file', async function () {
-      const fields = omit(baseCorrectParams, 'targetUrl')
+      const fields = omit(baseCorrectParams, [ 'targetUrl' ])
       const attaches = {
         torrentfile: buildAbsoluteFixturePath('avatar-big.png')
       }
@@ -280,7 +278,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should fail with an invalid magnet URI', async function () {
-      let fields = omit(baseCorrectParams, 'targetUrl')
+      let fields = omit(baseCorrectParams, [ 'targetUrl' ])
       fields = { ...fields, magnetUri: 'blabla' }
 
       await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
@@ -339,7 +337,7 @@ describe('Test video imports API validator', function () {
         }
       })
 
-      let fields = omit(baseCorrectParams, 'targetUrl')
+      let fields = omit(baseCorrectParams, [ 'targetUrl' ])
       fields = { ...fields, magnetUri: FIXTURE_URLS.magnet }
 
       await makePostBodyRequest({
@@ -350,7 +348,7 @@ describe('Test video imports API validator', function () {
         expectedStatus: HttpStatusCode.CONFLICT_409
       })
 
-      fields = omit(fields, 'magnetUri')
+      fields = omit(fields, [ 'magnetUri' ])
       const attaches = {
         torrentfile: buildAbsoluteFixturePath('video-720p.torrent')
       }