aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/friendsBasic.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-07-18 17:17:52 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-07-18 17:17:52 +0200
commit1a42c9e2c0fb64cdbebd81b311736e752f591e0a (patch)
treee893324d730878257491428ffca634a92f1eea05 /server/tests/api/friendsBasic.js
parentd56ec0d4129160a6e3b51ace3766bb325db1f101 (diff)
downloadPeerTube-1a42c9e2c0fb64cdbebd81b311736e752f591e0a.tar.gz
PeerTube-1a42c9e2c0fb64cdbebd81b311736e752f591e0a.tar.zst
PeerTube-1a42c9e2c0fb64cdbebd81b311736e752f591e0a.zip
Server: udpate async to 2.0.0
Diffstat (limited to 'server/tests/api/friendsBasic.js')
-rw-r--r--server/tests/api/friendsBasic.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/server/tests/api/friendsBasic.js b/server/tests/api/friendsBasic.js
index 5b738ad39..c74a7f224 100644
--- a/server/tests/api/friendsBasic.js
+++ b/server/tests/api/friendsBasic.js
@@ -1,8 +1,9 @@
1'use strict' 1'use strict'
2 2
3const async = require('async')
4const chai = require('chai') 3const chai = require('chai')
4const each = require('async/each')
5const expect = chai.expect 5const expect = chai.expect
6const series = require('async/series')
6 7
7const utils = require('./utils') 8const utils = require('./utils')
8 9
@@ -45,7 +46,7 @@ describe('Test basic friends', function () {
45 utils.flushAndRunMultipleServers(3, function (serversRun, urlsRun) { 46 utils.flushAndRunMultipleServers(3, function (serversRun, urlsRun) {
46 servers = serversRun 47 servers = serversRun
47 48
48 async.each(servers, function (server, callbackEach) { 49 each(servers, function (server, callbackEach) {
49 utils.loginAndGetAccessToken(server, function (err, accessToken) { 50 utils.loginAndGetAccessToken(server, function (err, accessToken) {
50 if (err) return callbackEach(err) 51 if (err) return callbackEach(err)
51 52
@@ -57,7 +58,7 @@ describe('Test basic friends', function () {
57 }) 58 })
58 59
59 it('Should not have friends', function (done) { 60 it('Should not have friends', function (done) {
60 async.each(servers, function (server, callback) { 61 each(servers, function (server, callback) {
61 utils.getFriendsList(server.url, function (err, res) { 62 utils.getFriendsList(server.url, function (err, res) {
62 if (err) throw err 63 if (err) throw err
63 64
@@ -72,7 +73,7 @@ describe('Test basic friends', function () {
72 it('Should make friends', function (done) { 73 it('Should make friends', function (done) {
73 this.timeout(10000) 74 this.timeout(10000)
74 75
75 async.series([ 76 series([
76 // The second pod make friend with the third 77 // The second pod make friend with the third
77 function (next) { 78 function (next) {
78 makeFriends(2, next) 79 makeFriends(2, next)
@@ -119,7 +120,7 @@ describe('Test basic friends', function () {
119 // Now each pod should be friend with the other ones 120 // Now each pod should be friend with the other ones
120 function (err) { 121 function (err) {
121 if (err) throw err 122 if (err) throw err
122 async.each(servers, function (server, callback) { 123 each(servers, function (server, callback) {
123 testMadeFriends(servers, server, callback) 124 testMadeFriends(servers, server, callback)
124 }, done) 125 }, done)
125 }) 126 })
@@ -131,7 +132,7 @@ describe('Test basic friends', function () {
131 }) 132 })
132 133
133 it('Should quit friends of pod 2', function (done) { 134 it('Should quit friends of pod 2', function (done) {
134 async.series([ 135 series([
135 // Pod 1 quit friends 136 // Pod 1 quit friends
136 function (next) { 137 function (next) {
137 const server = servers[1] 138 const server = servers[1]
@@ -151,7 +152,7 @@ describe('Test basic friends', function () {
151 }, 152 },
152 // Other pods shouldn't have pod 1 too 153 // Other pods shouldn't have pod 1 too
153 function (next) { 154 function (next) {
154 async.each([ servers[0].url, servers[2].url ], function (url, callback) { 155 each([ servers[0].url, servers[2].url ], function (url, callback) {
155 utils.getFriendsList(url, function (err, res) { 156 utils.getFriendsList(url, function (err, res) {
156 if (err) throw err 157 if (err) throw err
157 158
@@ -169,7 +170,7 @@ describe('Test basic friends', function () {
169 it('Should allow pod 2 to make friend again', function (done) { 170 it('Should allow pod 2 to make friend again', function (done) {
170 const server = servers[1] 171 const server = servers[1]
171 utils.makeFriends(server.url, server.accessToken, function () { 172 utils.makeFriends(server.url, server.accessToken, function () {
172 async.each(servers, function (server, callback) { 173 each(servers, function (server, callback) {
173 testMadeFriends(servers, server, callback) 174 testMadeFriends(servers, server, callback)
174 }, done) 175 }, done)
175 }) 176 })