aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/requests/requests.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-06 11:45:24 +0200
committerChocobozzz <me@florianbigard.com>2018-08-06 11:45:24 +0200
commit2769e297ca6703f761f9b57792585eb1fc5aac49 (patch)
tree02969989eb6f19a3f4ca8d75b882199662fe00e1 /server/tests/utils/requests/requests.ts
parent9484e1f6fcc9cbc118b01579acd1fd6d49bfce2e (diff)
downloadPeerTube-2769e297ca6703f761f9b57792585eb1fc5aac49.tar.gz
PeerTube-2769e297ca6703f761f9b57792585eb1fc5aac49.tar.zst
PeerTube-2769e297ca6703f761f9b57792585eb1fc5aac49.zip
Fix caption upload on Mac OS
Diffstat (limited to 'server/tests/utils/requests/requests.ts')
-rw-r--r--server/tests/utils/requests/requests.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/tests/utils/requests/requests.ts b/server/tests/utils/requests/requests.ts
index b88b3ce5b..fc7b38b8c 100644
--- a/server/tests/utils/requests/requests.ts
+++ b/server/tests/utils/requests/requests.ts
@@ -48,7 +48,7 @@ function makeUploadRequest (options: {
48 path: string, 48 path: string,
49 token?: string, 49 token?: string,
50 fields: { [ fieldName: string ]: any }, 50 fields: { [ fieldName: string ]: any },
51 attaches: { [ attachName: string ]: any }, 51 attaches: { [ attachName: string ]: any | any[] },
52 statusCodeExpected?: number 52 statusCodeExpected?: number
53}) { 53}) {
54 if (!options.statusCodeExpected) options.statusCodeExpected = 400 54 if (!options.statusCodeExpected) options.statusCodeExpected = 400
@@ -78,7 +78,11 @@ function makeUploadRequest (options: {
78 78
79 Object.keys(options.attaches).forEach(attach => { 79 Object.keys(options.attaches).forEach(attach => {
80 const value = options.attaches[attach] 80 const value = options.attaches[attach]
81 req.attach(attach, buildAbsoluteFixturePath(value)) 81 if (Array.isArray(value)) {
82 req.attach(attach, buildAbsoluteFixturePath(value[0]), value[1])
83 } else {
84 req.attach(attach, buildAbsoluteFixturePath(value))
85 }
82 }) 86 })
83 87
84 return req.expect(options.statusCodeExpected) 88 return req.expect(options.statusCodeExpected)