aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/friendsBasic.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-16 22:29:27 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-16 22:29:27 +0100
commitf0f5567b6918fc60c8cab15e13aec03a89a91dfb (patch)
tree99dfdb9fa8273c9cda1360fd3b6bfccc515bf8be /server/tests/api/friendsBasic.js
parent5101105ef91bfe478f97546b78b321882da2079c (diff)
downloadPeerTube-f0f5567b6918fc60c8cab15e13aec03a89a91dfb.tar.gz
PeerTube-f0f5567b6918fc60c8cab15e13aec03a89a91dfb.tar.zst
PeerTube-f0f5567b6918fc60c8cab15e13aec03a89a91dfb.zip
Use const/let now we use node 4.2
Diffstat (limited to 'server/tests/api/friendsBasic.js')
-rw-r--r--server/tests/api/friendsBasic.js36
1 files changed, 18 insertions, 18 deletions
diff --git a/server/tests/api/friendsBasic.js b/server/tests/api/friendsBasic.js
index 328724936..62eac51ec 100644
--- a/server/tests/api/friendsBasic.js
+++ b/server/tests/api/friendsBasic.js
@@ -1,19 +1,19 @@
1'use strict' 1'use strict'
2 2
3var async = require('async') 3const async = require('async')
4var chai = require('chai') 4const chai = require('chai')
5var expect = chai.expect 5const expect = chai.expect
6var request = require('supertest') 6const request = require('supertest')
7 7
8var utils = require('./utils') 8const utils = require('./utils')
9 9
10describe('Test basic friends', function () { 10describe('Test basic friends', function () {
11 var apps = [] 11 let apps = []
12 var urls = [] 12 let urls = []
13 13
14 function testMadeFriends (urls, url_to_test, callback) { 14 function testMadeFriends (urls, url_to_test, callback) {
15 var friends = [] 15 const friends = []
16 for (var i = 0; i < urls.length; i++) { 16 for (let i = 0; i < urls.length; i++) {
17 if (urls[i] === url_to_test) continue 17 if (urls[i] === url_to_test) continue
18 friends.push(urls[i]) 18 friends.push(urls[i])
19 } 19 }
@@ -21,13 +21,13 @@ describe('Test basic friends', function () {
21 utils.getFriendsList(url_to_test, function (err, res) { 21 utils.getFriendsList(url_to_test, function (err, res) {
22 if (err) throw err 22 if (err) throw err
23 23
24 var result = res.body 24 const result = res.body
25 var result_urls = [ result[0].url, result[1].url ] 25 const result_urls = [ result[0].url, result[1].url ]
26 expect(result).to.be.an('array') 26 expect(result).to.be.an('array')
27 expect(result.length).to.equal(2) 27 expect(result.length).to.equal(2)
28 expect(result_urls[0]).to.not.equal(result_urls[1]) 28 expect(result_urls[0]).to.not.equal(result_urls[1])
29 29
30 var error_string = 'Friends url do not correspond for ' + url_to_test 30 const error_string = 'Friends url do not correspond for ' + url_to_test
31 expect(friends).to.contain(result_urls[0], error_string) 31 expect(friends).to.contain(result_urls[0], error_string)
32 expect(friends).to.contain(result_urls[1], error_string) 32 expect(friends).to.contain(result_urls[1], error_string)
33 callback() 33 callback()
@@ -50,7 +50,7 @@ describe('Test basic friends', function () {
50 utils.getFriendsList(url, function (err, res) { 50 utils.getFriendsList(url, function (err, res) {
51 if (err) throw err 51 if (err) throw err
52 52
53 var result = res.body 53 const result = res.body
54 expect(result).to.be.an('array') 54 expect(result).to.be.an('array')
55 expect(result.length).to.equal(0) 55 expect(result.length).to.equal(0)
56 callback() 56 callback()
@@ -61,7 +61,7 @@ describe('Test basic friends', function () {
61 it('Should make friends', function (done) { 61 it('Should make friends', function (done) {
62 this.timeout(10000) 62 this.timeout(10000)
63 63
64 var path = '/api/v1/pods/makefriends' 64 const path = '/api/v1/pods/makefriends'
65 65
66 async.series([ 66 async.series([
67 // The second pod make friend with the third 67 // The second pod make friend with the third
@@ -81,7 +81,7 @@ describe('Test basic friends', function () {
81 utils.getFriendsList(urls[1], function (err, res) { 81 utils.getFriendsList(urls[1], function (err, res) {
82 if (err) throw err 82 if (err) throw err
83 83
84 var result = res.body 84 const result = res.body
85 expect(result).to.be.an('array') 85 expect(result).to.be.an('array')
86 expect(result.length).to.equal(1) 86 expect(result.length).to.equal(1)
87 expect(result[0].url).to.be.equal(urls[2]) 87 expect(result[0].url).to.be.equal(urls[2])
@@ -94,7 +94,7 @@ describe('Test basic friends', function () {
94 utils.getFriendsList(urls[2], function (err, res) { 94 utils.getFriendsList(urls[2], function (err, res) {
95 if (err) throw err 95 if (err) throw err
96 96
97 var result = res.body 97 const result = res.body
98 expect(result).to.be.an('array') 98 expect(result).to.be.an('array')
99 expect(result.length).to.equal(1) 99 expect(result.length).to.equal(1)
100 expect(result[0].url).to.be.equal(urls[1]) 100 expect(result[0].url).to.be.equal(urls[1])
@@ -139,7 +139,7 @@ describe('Test basic friends', function () {
139 utils.getFriendsList(urls[1], function (err, res) { 139 utils.getFriendsList(urls[1], function (err, res) {
140 if (err) throw err 140 if (err) throw err
141 141
142 var result = res.body 142 const result = res.body
143 expect(result).to.be.an('array') 143 expect(result).to.be.an('array')
144 expect(result.length).to.equal(0) 144 expect(result.length).to.equal(0)
145 145
@@ -152,7 +152,7 @@ describe('Test basic friends', function () {
152 utils.getFriendsList(url, function (err, res) { 152 utils.getFriendsList(url, function (err, res) {
153 if (err) throw err 153 if (err) throw err
154 154
155 var result = res.body 155 const result = res.body
156 expect(result).to.be.an('array') 156 expect(result).to.be.an('array')
157 expect(result.length).to.equal(1) 157 expect(result.length).to.equal(1)
158 expect(result[0].url).not.to.be.equal(urls[1]) 158 expect(result[0].url).not.to.be.equal(urls[1])