diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:25:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:25:58 +0200 |
commit | bbd5aa7ead5f1554a0872963f957effc26d8c630 (patch) | |
tree | a32cad420cfabe4eab5df4e3f104fa34f734fa7d /server/tests/api/check-params/metrics.ts | |
parent | a85d530384761a0af833caac9b38b9834517c9fa (diff) | |
download | PeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.tar.gz PeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.tar.zst PeerTube-bbd5aa7ead5f1554a0872963f957effc26d8c630.zip |
Reimplement a typed omit function
Diffstat (limited to 'server/tests/api/check-params/metrics.ts')
-rw-r--r-- | server/tests/api/check-params/metrics.ts | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/server/tests/api/check-params/metrics.ts b/server/tests/api/check-params/metrics.ts index 2d4509406..be8253217 100644 --- a/server/tests/api/check-params/metrics.ts +++ b/server/tests/api/check-params/metrics.ts | |||
@@ -1,7 +1,6 @@ | |||
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 { omit } from '@shared/core-utils' |
4 | import { omit } from 'lodash' | ||
5 | import { HttpStatusCode, PlaybackMetricCreate, VideoResolution } from '@shared/models' | 4 | import { HttpStatusCode, PlaybackMetricCreate, VideoResolution } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | 5 | import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' |
7 | 6 | ||
@@ -66,7 +65,7 @@ describe('Test metrics API validators', function () { | |||
66 | await makePostBodyRequest({ | 65 | await makePostBodyRequest({ |
67 | url: server.url, | 66 | url: server.url, |
68 | path, | 67 | path, |
69 | fields: omit(baseParams, 'playerMode') | 68 | fields: omit(baseParams, [ 'playerMode' ]) |
70 | }) | 69 | }) |
71 | 70 | ||
72 | await makePostBodyRequest({ | 71 | await makePostBodyRequest({ |
@@ -80,7 +79,7 @@ describe('Test metrics API validators', function () { | |||
80 | await makePostBodyRequest({ | 79 | await makePostBodyRequest({ |
81 | url: server.url, | 80 | url: server.url, |
82 | path, | 81 | path, |
83 | fields: omit(baseParams, 'resolutionChanges') | 82 | fields: omit(baseParams, [ 'resolutionChanges' ]) |
84 | }) | 83 | }) |
85 | 84 | ||
86 | await makePostBodyRequest({ | 85 | await makePostBodyRequest({ |
@@ -98,7 +97,7 @@ describe('Test metrics API validators', function () { | |||
98 | await makePostBodyRequest({ | 97 | await makePostBodyRequest({ |
99 | url: server.url, | 98 | url: server.url, |
100 | path, | 99 | path, |
101 | fields: omit(baseParams, 'errors') | 100 | fields: omit(baseParams, [ 'errors' ]) |
102 | }) | 101 | }) |
103 | 102 | ||
104 | await makePostBodyRequest({ | 103 | await makePostBodyRequest({ |
@@ -112,7 +111,7 @@ describe('Test metrics API validators', function () { | |||
112 | await makePostBodyRequest({ | 111 | await makePostBodyRequest({ |
113 | url: server.url, | 112 | url: server.url, |
114 | path, | 113 | path, |
115 | fields: omit(baseParams, 'downloadedBytesP2P') | 114 | fields: omit(baseParams, [ 'downloadedBytesP2P' ]) |
116 | }) | 115 | }) |
117 | 116 | ||
118 | await makePostBodyRequest({ | 117 | await makePostBodyRequest({ |
@@ -126,7 +125,7 @@ describe('Test metrics API validators', function () { | |||
126 | await makePostBodyRequest({ | 125 | await makePostBodyRequest({ |
127 | url: server.url, | 126 | url: server.url, |
128 | path, | 127 | path, |
129 | fields: omit(baseParams, 'downloadedBytesHTTP') | 128 | fields: omit(baseParams, [ 'downloadedBytesHTTP' ]) |
130 | }) | 129 | }) |
131 | 130 | ||
132 | await makePostBodyRequest({ | 131 | await makePostBodyRequest({ |
@@ -140,7 +139,7 @@ describe('Test metrics API validators', function () { | |||
140 | await makePostBodyRequest({ | 139 | await makePostBodyRequest({ |
141 | url: server.url, | 140 | url: server.url, |
142 | path, | 141 | path, |
143 | fields: omit(baseParams, 'uploadedBytesP2P') | 142 | fields: omit(baseParams, [ 'uploadedBytesP2P' ]) |
144 | }) | 143 | }) |
145 | 144 | ||
146 | await makePostBodyRequest({ | 145 | await makePostBodyRequest({ |