diff options
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/requests.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/tests/utils/requests.js b/server/tests/utils/requests.js index b1470814d..84cf3483f 100644 --- a/server/tests/utils/requests.js +++ b/server/tests/utils/requests.js | |||
@@ -36,7 +36,8 @@ function makePostUploadRequest (url, path, token, fields, attaches, done, status | |||
36 | req.attach(attach, value) | 36 | req.attach(attach, value) |
37 | }) | 37 | }) |
38 | 38 | ||
39 | req.expect(statusCodeExpected, done) | 39 | req.expect(statusCodeExpected) |
40 | .end(done) | ||
40 | } | 41 | } |
41 | 42 | ||
42 | function makePostBodyRequest (url, path, token, fields, done, statusCodeExpected) { | 43 | function makePostBodyRequest (url, path, token, fields, done, statusCodeExpected) { |
@@ -48,7 +49,9 @@ function makePostBodyRequest (url, path, token, fields, done, statusCodeExpected | |||
48 | 49 | ||
49 | if (token) req.set('Authorization', 'Bearer ' + token) | 50 | if (token) req.set('Authorization', 'Bearer ' + token) |
50 | 51 | ||
51 | req.send(fields).expect(statusCodeExpected, done) | 52 | req.send(fields) |
53 | .expect(statusCodeExpected) | ||
54 | .end(done) | ||
52 | } | 55 | } |
53 | 56 | ||
54 | function makePutBodyRequest (url, path, token, fields, done, statusCodeExpected) { | 57 | function makePutBodyRequest (url, path, token, fields, done, statusCodeExpected) { |
@@ -60,7 +63,9 @@ function makePutBodyRequest (url, path, token, fields, done, statusCodeExpected) | |||
60 | 63 | ||
61 | if (token) req.set('Authorization', 'Bearer ' + token) | 64 | if (token) req.set('Authorization', 'Bearer ' + token) |
62 | 65 | ||
63 | req.send(fields).expect(statusCodeExpected, done) | 66 | req.send(fields) |
67 | .expect(statusCodeExpected) | ||
68 | .end(done) | ||
64 | } | 69 | } |
65 | 70 | ||
66 | // --------------------------------------------------------------------------- | 71 | // --------------------------------------------------------------------------- |