diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 10:42:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (patch) | |
tree | baf29753ac5d4598643e3bee719f8df0cc36c59d /server/tests/api/check-params/services.ts | |
parent | 08642a765ea514a00f159db898edf14c376fbe6c (diff) | |
download | PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.gz PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.zst PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.zip |
Refactor requests
Diffstat (limited to 'server/tests/api/check-params/services.ts')
-rw-r--r-- | server/tests/api/check-params/services.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts index c623240b7..973b25598 100644 --- a/server/tests/api/check-params/services.ts +++ b/server/tests/api/check-params/services.ts | |||
@@ -1,7 +1,7 @@ | |||
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 'mocha' |
4 | import { HttpStatusCode } from '@shared/core-utils' | 4 | import { HttpStatusCode } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
7 | createSingleServer, | 7 | createSingleServer, |
@@ -120,13 +120,13 @@ describe('Test services API validators', function () { | |||
120 | }) | 120 | }) |
121 | }) | 121 | }) |
122 | 122 | ||
123 | function checkParamEmbed (server: PeerTubeServer, embedUrl: string, statusCodeExpected = HttpStatusCode.BAD_REQUEST_400, query = {}) { | 123 | function checkParamEmbed (server: PeerTubeServer, embedUrl: string, expectedStatus = HttpStatusCode.BAD_REQUEST_400, query = {}) { |
124 | const path = '/services/oembed' | 124 | const path = '/services/oembed' |
125 | 125 | ||
126 | return makeGetRequest({ | 126 | return makeGetRequest({ |
127 | url: server.url, | 127 | url: server.url, |
128 | path, | 128 | path, |
129 | query: Object.assign(query, { url: embedUrl }), | 129 | query: Object.assign(query, { url: embedUrl }), |
130 | statusCodeExpected | 130 | expectedStatus |
131 | }) | 131 | }) |
132 | } | 132 | } |