aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-17 15:25:58 +0200
committerChocobozzz <me@florianbigard.com>2022-08-17 15:25:58 +0200
commitbbd5aa7ead5f1554a0872963f957effc26d8c630 (patch)
treea32cad420cfabe4eab5df4e3f104fa34f734fa7d /server/tests/api/check-params/video-channels.ts
parenta85d530384761a0af833caac9b38b9834517c9fa (diff)
downloadPeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.tar.gz
PeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.tar.zst
PeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.zip
Reimplement a typed omit function
Diffstat (limited to 'server/tests/api/check-params/video-channels.ts')
-rw-r--r--server/tests/api/check-params/video-channels.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index 9024126c0..1782474fd 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -1,10 +1,8 @@
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
3import 'mocha' 3import { expect } from 'chai'
4import * as chai from 'chai'
5import { omit } from 'lodash'
6import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' 4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
7import { buildAbsoluteFixturePath } from '@shared/core-utils' 5import { buildAbsoluteFixturePath, omit } from '@shared/core-utils'
8import { HttpStatusCode, VideoChannelUpdate } from '@shared/models' 6import { HttpStatusCode, VideoChannelUpdate } from '@shared/models'
9import { 7import {
10 ChannelsCommand, 8 ChannelsCommand,
@@ -18,8 +16,6 @@ import {
18 setAccessTokensToServers 16 setAccessTokensToServers
19} from '@shared/server-commands' 17} from '@shared/server-commands'
20 18
21const expect = chai.expect
22
23describe('Test video channels API validator', function () { 19describe('Test video channels API validator', function () {
24 const videoChannelPath = '/api/v1/video-channels' 20 const videoChannelPath = '/api/v1/video-channels'
25 let server: PeerTubeServer 21 let server: PeerTubeServer
@@ -121,7 +117,7 @@ describe('Test video channels API validator', function () {
121 }) 117 })
122 118
123 it('Should fail without a name', async function () { 119 it('Should fail without a name', async function () {
124 const fields = omit(baseCorrectParams, 'name') 120 const fields = omit(baseCorrectParams, [ 'name' ])
125 await makePostBodyRequest({ url: server.url, path: videoChannelPath, token: server.accessToken, fields }) 121 await makePostBodyRequest({ url: server.url, path: videoChannelPath, token: server.accessToken, fields })
126 }) 122 })
127 123
@@ -131,7 +127,7 @@ describe('Test video channels API validator', function () {
131 }) 127 })
132 128
133 it('Should fail without a name', async function () { 129 it('Should fail without a name', async function () {
134 const fields = omit(baseCorrectParams, 'displayName') 130 const fields = omit(baseCorrectParams, [ 'displayName' ])
135 await makePostBodyRequest({ url: server.url, path: videoChannelPath, token: server.accessToken, fields }) 131 await makePostBodyRequest({ url: server.url, path: videoChannelPath, token: server.accessToken, fields })
136 }) 132 })
137 133