diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-09-07 17:58:09 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-09-07 17:58:09 +0200 |
commit | 8df87ce792be7b0ccdad4cb703e5ca3be66d214a (patch) | |
tree | f28b8705da384f99009f1a63942616aa244d6552 /server/tests/utils | |
parent | fdbda9e3d6564ec908733c7019305f6a3c363a9f (diff) | |
download | PeerTube-8df87ce792be7b0ccdad4cb703e5ca3be66d214a.tar.gz PeerTube-8df87ce792be7b0ccdad4cb703e5ca3be66d214a.tar.zst PeerTube-8df87ce792be7b0ccdad4cb703e5ca3be66d214a.zip |
Convert real world tools to typescript
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/cli.ts | 2 | ||||
-rw-r--r-- | server/tests/utils/clients.ts | 2 | ||||
-rw-r--r-- | server/tests/utils/videos.ts | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/server/tests/utils/cli.ts b/server/tests/utils/cli.ts index 5f07a832e..4098fdf6f 100644 --- a/server/tests/utils/cli.ts +++ b/server/tests/utils/cli.ts | |||
@@ -7,7 +7,7 @@ function getEnvCli (server?: ServerInfo) { | |||
7 | } | 7 | } |
8 | 8 | ||
9 | async function execCLI (command: string) { | 9 | async function execCLI (command: string) { |
10 | return new Promise((res, rej) => { | 10 | return new Promise<string>((res, rej) => { |
11 | exec(command, (err, stdout, stderr) => { | 11 | exec(command, (err, stdout, stderr) => { |
12 | if (err) return rej(err) | 12 | if (err) return rej(err) |
13 | 13 | ||
diff --git a/server/tests/utils/clients.ts b/server/tests/utils/clients.ts index 22676bb38..a8c5b51c5 100644 --- a/server/tests/utils/clients.ts +++ b/server/tests/utils/clients.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | 2 | ||
3 | function getClient (url: string) { | 3 | function getClient (url: string) { |
4 | const path = '/api/v1/clients/local' | 4 | const path = '/api/v1/oauth-clients/local' |
5 | 5 | ||
6 | return request(url) | 6 | return request(url) |
7 | .get(path) | 7 | .get(path) |
diff --git a/server/tests/utils/videos.ts b/server/tests/utils/videos.ts index 509a2430a..83271beca 100644 --- a/server/tests/utils/videos.ts +++ b/server/tests/utils/videos.ts | |||
@@ -185,10 +185,13 @@ function uploadVideo (url: string, accessToken: string, videoAttributesArg: Vide | |||
185 | .field('name', attributes.name) | 185 | .field('name', attributes.name) |
186 | .field('category', attributes.category.toString()) | 186 | .field('category', attributes.category.toString()) |
187 | .field('licence', attributes.licence.toString()) | 187 | .field('licence', attributes.licence.toString()) |
188 | .field('language', attributes.language.toString()) | ||
189 | .field('nsfw', JSON.stringify(attributes.nsfw)) | 188 | .field('nsfw', JSON.stringify(attributes.nsfw)) |
190 | .field('description', attributes.description) | 189 | .field('description', attributes.description) |
191 | 190 | ||
191 | if (attributes.language !== undefined) { | ||
192 | req.field('language', attributes.language.toString()) | ||
193 | } | ||
194 | |||
192 | for (let i = 0; i < attributes.tags.length; i++) { | 195 | for (let i = 0; i < attributes.tags.length; i++) { |
193 | req.field('tags[' + i + ']', attributes.tags[i]) | 196 | req.field('tags[' + i + ']', attributes.tags[i]) |
194 | } | 197 | } |