aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/multiplePods.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/multiplePods.js')
-rw-r--r--server/tests/api/multiplePods.js50
1 files changed, 25 insertions, 25 deletions
diff --git a/server/tests/api/multiplePods.js b/server/tests/api/multiplePods.js
index b361e373b..f1415f6f1 100644
--- a/server/tests/api/multiplePods.js
+++ b/server/tests/api/multiplePods.js
@@ -11,7 +11,7 @@ webtorrent.silent = true
11 11
12describe('Test multiple pods', function () { 12describe('Test multiple pods', function () {
13 let servers = [] 13 let servers = []
14 const to_remove = [] 14 const toRemove = []
15 15
16 before(function (done) { 16 before(function (done) {
17 this.timeout(30000) 17 this.timeout(30000)
@@ -19,19 +19,19 @@ describe('Test multiple pods', function () {
19 async.series([ 19 async.series([
20 // Run servers 20 // Run servers
21 function (next) { 21 function (next) {
22 utils.flushAndRunMultipleServers(3, function (servers_run) { 22 utils.flushAndRunMultipleServers(3, function (serversRun) {
23 servers = servers_run 23 servers = serversRun
24 next() 24 next()
25 }) 25 })
26 }, 26 },
27 // Get the access tokens 27 // Get the access tokens
28 function (next) { 28 function (next) {
29 async.each(servers, function (server, callback_each) { 29 async.each(servers, function (server, callbackEach) {
30 utils.loginAndGetAccessToken(server, function (err, access_token) { 30 utils.loginAndGetAccessToken(server, function (err, accessToken) {
31 if (err) return callback_each(err) 31 if (err) return callbackEach(err)
32 32
33 server.access_token = access_token 33 server.accessToken = accessToken
34 callback_each() 34 callbackEach()
35 }) 35 })
36 }, next) 36 }, next)
37 }, 37 },
@@ -82,7 +82,7 @@ describe('Test multiple pods', function () {
82 if (err) throw err 82 if (err) throw err
83 83
84 async.each(servers, function (server, callback) { 84 async.each(servers, function (server, callback) {
85 let base_magnet = null 85 let baseMagnet = null
86 86
87 utils.getVideosList(server.url, function (err, res) { 87 utils.getVideosList(server.url, function (err, res) {
88 if (err) throw err 88 if (err) throw err
@@ -104,8 +104,8 @@ describe('Test multiple pods', function () {
104 } 104 }
105 105
106 // All pods should have the same magnet Uri 106 // All pods should have the same magnet Uri
107 if (base_magnet === null) { 107 if (baseMagnet === null) {
108 base_magnet = video.magnetUri 108 baseMagnet = video.magnetUri
109 } else { 109 } else {
110 expect(video.magnetUri).to.equal.magnetUri 110 expect(video.magnetUri).to.equal.magnetUri
111 } 111 }
@@ -137,7 +137,7 @@ describe('Test multiple pods', function () {
137 if (err) throw err 137 if (err) throw err
138 138
139 async.each(servers, function (server, callback) { 139 async.each(servers, function (server, callback) {
140 let base_magnet = null 140 let baseMagnet = null
141 141
142 utils.getVideosList(server.url, function (err, res) { 142 utils.getVideosList(server.url, function (err, res) {
143 if (err) throw err 143 if (err) throw err
@@ -159,8 +159,8 @@ describe('Test multiple pods', function () {
159 } 159 }
160 160
161 // All pods should have the same magnet Uri 161 // All pods should have the same magnet Uri
162 if (base_magnet === null) { 162 if (baseMagnet === null) {
163 base_magnet = video.magnetUri 163 baseMagnet = video.magnetUri
164 } else { 164 } else {
165 expect(video.magnetUri).to.equal.magnetUri 165 expect(video.magnetUri).to.equal.magnetUri
166 } 166 }
@@ -193,7 +193,7 @@ describe('Test multiple pods', function () {
193 function (err) { 193 function (err) {
194 if (err) throw err 194 if (err) throw err
195 195
196 let base_magnet = null 196 let baseMagnet = null
197 // All pods should have this video 197 // All pods should have this video
198 async.each(servers, function (server, callback) { 198 async.each(servers, function (server, callback) {
199 utils.getVideosList(server.url, function (err, res) { 199 utils.getVideosList(server.url, function (err, res) {
@@ -235,8 +235,8 @@ describe('Test multiple pods', function () {
235 } 235 }
236 236
237 // All pods should have the same magnet Uri 237 // All pods should have the same magnet Uri
238 if (base_magnet === null) { 238 if (baseMagnet === null) {
239 base_magnet = video2.magnetUri 239 baseMagnet = video2.magnetUri
240 } else { 240 } else {
241 expect(video2.magnetUri).to.equal.magnetUri 241 expect(video2.magnetUri).to.equal.magnetUri
242 } 242 }
@@ -268,8 +268,8 @@ describe('Test multiple pods', function () {
268 if (err) throw err 268 if (err) throw err
269 269
270 const video = res.body[0] 270 const video = res.body[0]
271 to_remove.push(res.body[2].id) 271 toRemove.push(res.body[2].id)
272 to_remove.push(res.body[3].id) 272 toRemove.push(res.body[3].id)
273 273
274 webtorrent.add(video.magnetUri, function (torrent) { 274 webtorrent.add(video.magnetUri, function (torrent) {
275 expect(torrent.files).to.exist 275 expect(torrent.files).to.exist
@@ -343,10 +343,10 @@ describe('Test multiple pods', function () {
343 343
344 async.series([ 344 async.series([
345 function (next) { 345 function (next) {
346 utils.removeVideo(servers[2].url, servers[2].access_token, to_remove[0], next) 346 utils.removeVideo(servers[2].url, servers[2].accessToken, toRemove[0], next)
347 }, 347 },
348 function (next) { 348 function (next) {
349 utils.removeVideo(servers[2].url, servers[2].access_token, to_remove[1], next) 349 utils.removeVideo(servers[2].url, servers[2].accessToken, toRemove[1], next)
350 }], 350 }],
351 function (err) { 351 function (err) {
352 if (err) throw err 352 if (err) throw err
@@ -364,10 +364,10 @@ describe('Test multiple pods', function () {
364 expect(videos).to.be.an('array') 364 expect(videos).to.be.an('array')
365 expect(videos.length).to.equal(2) 365 expect(videos.length).to.equal(2)
366 expect(videos[0].id).not.to.equal(videos[1].id) 366 expect(videos[0].id).not.to.equal(videos[1].id)
367 expect(videos[0].id).not.to.equal(to_remove[0]) 367 expect(videos[0].id).not.to.equal(toRemove[0])
368 expect(videos[1].id).not.to.equal(to_remove[0]) 368 expect(videos[1].id).not.to.equal(toRemove[0])
369 expect(videos[0].id).not.to.equal(to_remove[1]) 369 expect(videos[0].id).not.to.equal(toRemove[1])
370 expect(videos[1].id).not.to.equal(to_remove[1]) 370 expect(videos[1].id).not.to.equal(toRemove[1])
371 371
372 callback() 372 callback()
373 }) 373 })