aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/api/utils.js')
-rw-r--r--tests/api/utils.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/api/utils.js b/tests/api/utils.js
index a1996b4d7..b71e943ed 100644
--- a/tests/api/utils.js
+++ b/tests/api/utils.js
@@ -4,6 +4,7 @@
4 var child_process = require('child_process') 4 var child_process = require('child_process')
5 var exec = child_process.exec 5 var exec = child_process.exec
6 var fork = child_process.fork 6 var fork = child_process.fork
7 var pathUtils = require('path')
7 var request = require('supertest') 8 var request = require('supertest')
8 9
9 var testUtils = { 10 var testUtils = {
@@ -22,7 +23,7 @@
22 // ---------------------- Export functions -------------------- 23 // ---------------------- Export functions --------------------
23 24
24 function flushTests (callback) { 25 function flushTests (callback) {
25 exec(__dirname + '/../../scripts/clean_test.sh', callback) 26 exec(pathUtils.join(__dirname, '../../scripts/clean_test.sh'), callback)
26 } 27 }
27 28
28 function getFriendsList (url, end) { 29 function getFriendsList (url, end) {
@@ -139,7 +140,7 @@
139 detached: true 140 detached: true
140 } 141 }
141 142
142 var app = fork(__dirname + '/../../server.js', [], options) 143 var app = fork(pathUtils.join(__dirname, '../../server.js'), [], options)
143 app.stdout.on('data', function onStdout (data) { 144 app.stdout.on('data', function onStdout (data) {
144 var dont_continue = false 145 var dont_continue = false
145 // Check if all required sentences are here 146 // Check if all required sentences are here
@@ -175,7 +176,7 @@
175 .set('Accept', 'application/json') 176 .set('Accept', 'application/json')
176 .field('name', name) 177 .field('name', name)
177 .field('description', description) 178 .field('description', description)
178 .attach('input_video', __dirname + '/fixtures/' + fixture) 179 .attach('input_video', pathUtils.join(__dirname, 'fixtures', fixture))
179 .expect(201) 180 .expect(201)
180 .end(end) 181 .end(end)
181 } 182 }