- async.each(servers, function (server, callback_each) {
- utils.loginAndGetAccessToken(server, function (err, access_token) {
- if (err) return callback_each(err)
+ async.each(servers, function (server, callbackEach) {
+ utils.loginAndGetAccessToken(server, function (err, accessToken) {
+ if (err) return callbackEach(err)
- utils.makeFriends(servers[1].url, next)
+ const server = servers[1]
+ utils.makeFriends(server.url, server.accessToken, next)
- utils.makeFriends(servers[0].url, next)
+ const server = servers[0]
+ utils.makeFriends(server.url, server.accessToken, next)
- utils.uploadVideo(servers[0].url, servers[0].access_token, 'my super name for pod 1', 'my super description for pod 1', 'video_short1.webm', next)
+ utils.uploadVideo(servers[0].url, servers[0].accessToken, 'my super name for pod 1', 'my super description for pod 1', 'video_short1.webm', next)
expect(video.podUrl).to.equal('http://localhost:9001')
expect(video.magnetUri).to.exist
expect(video.duration).to.equal(10)
expect(video.podUrl).to.equal('http://localhost:9001')
expect(video.magnetUri).to.exist
expect(video.duration).to.equal(10)
- utils.uploadVideo(servers[1].url, servers[1].access_token, 'my super name for pod 2', 'my super description for pod 2', 'video_short2.webm', next)
+ utils.uploadVideo(servers[1].url, servers[1].accessToken, 'my super name for pod 2', 'my super description for pod 2', 'video_short2.webm', next)
expect(video.podUrl).to.equal('http://localhost:9002')
expect(video.magnetUri).to.exist
expect(video.duration).to.equal(5)
expect(video.podUrl).to.equal('http://localhost:9002')
expect(video.magnetUri).to.exist
expect(video.duration).to.equal(5)
- utils.uploadVideo(servers[2].url, servers[2].access_token, 'my super name for pod 3', 'my super description for pod 3', 'video_short3.webm', next)
+ utils.uploadVideo(servers[2].url, servers[2].accessToken, 'my super name for pod 3', 'my super description for pod 3', 'video_short3.webm', next)
- utils.uploadVideo(servers[2].url, servers[2].access_token, 'my super name for pod 3-2', 'my super description for pod 3-2', 'video_short.webm', next)
+ utils.uploadVideo(servers[2].url, servers[2].accessToken, 'my super name for pod 3-2', 'my super description for pod 3-2', 'video_short.webm', next)
// All pods should have this video
async.each(servers, function (server, callback) {
utils.getVideosList(server.url, function (err, res) {
// All pods should have this video
async.each(servers, function (server, callback) {
utils.getVideosList(server.url, function (err, res) {
expect(video1.podUrl).to.equal('http://localhost:9003')
expect(video1.magnetUri).to.exist
expect(video1.duration).to.equal(5)
expect(video1.podUrl).to.equal('http://localhost:9003')
expect(video1.magnetUri).to.exist
expect(video1.duration).to.equal(5)
expect(video2.name).to.equal('my super name for pod 3-2')
expect(video2.description).to.equal('my super description for pod 3-2')
expect(video2.podUrl).to.equal('http://localhost:9003')
expect(video2.magnetUri).to.exist
expect(video2.duration).to.equal(5)
expect(video2.name).to.equal('my super name for pod 3-2')
expect(video2.description).to.equal('my super description for pod 3-2')
expect(video2.podUrl).to.equal('http://localhost:9003')
expect(video2.magnetUri).to.exist
expect(video2.duration).to.equal(5)
webtorrent.add(video.magnetUri, function (torrent) {
expect(torrent.files).to.exist
webtorrent.add(video.magnetUri, function (torrent) {
expect(torrent.files).to.exist
- utils.removeVideo(servers[2].url, servers[2].access_token, to_remove[0], next)
+ utils.removeVideo(servers[2].url, servers[2].accessToken, toRemove[0], next)
- utils.removeVideo(servers[2].url, servers[2].access_token, to_remove[1], next)
+ utils.removeVideo(servers[2].url, servers[2].accessToken, toRemove[1], next)
expect(videos).to.be.an('array')
expect(videos.length).to.equal(2)
expect(videos[0].id).not.to.equal(videos[1].id)
expect(videos).to.be.an('array')
expect(videos.length).to.equal(2)
expect(videos[0].id).not.to.equal(videos[1].id)
- expect(videos[0].id).not.to.equal(to_remove[0])
- expect(videos[1].id).not.to.equal(to_remove[0])
- expect(videos[0].id).not.to.equal(to_remove[1])
- expect(videos[1].id).not.to.equal(to_remove[1])
+ expect(videos[0].id).not.to.equal(toRemove[0])
+ expect(videos[1].id).not.to.equal(toRemove[0])
+ expect(videos[0].id).not.to.equal(toRemove[1])
+ expect(videos[1].id).not.to.equal(toRemove[1])