diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-01-24 16:08:09 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-01-24 16:08:09 +0100 |
commit | ee66c5930e6c3694434a259dfb4b7f3e9f39cf7b (patch) | |
tree | a880612dca3247fde962417077680ea34cc96d20 /test/api/singlePod.js | |
parent | 45239549bf2659998dcf9196d86974b0b625912e (diff) | |
download | PeerTube-ee66c5930e6c3694434a259dfb4b7f3e9f39cf7b.tar.gz PeerTube-ee66c5930e6c3694434a259dfb4b7f3e9f39cf7b.tar.zst PeerTube-ee66c5930e6c3694434a259dfb4b7f3e9f39cf7b.zip |
Tests refractoring
Diffstat (limited to 'test/api/singlePod.js')
-rw-r--r-- | test/api/singlePod.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/test/api/singlePod.js b/test/api/singlePod.js index be944d8da..a8ae43aee 100644 --- a/test/api/singlePod.js +++ b/test/api/singlePod.js | |||
@@ -1,6 +1,7 @@ | |||
1 | ;(function () { | 1 | ;(function () { |
2 | 'use strict' | 2 | 'use strict' |
3 | 3 | ||
4 | var async = require('async') | ||
4 | var chai = require('chai') | 5 | var chai = require('chai') |
5 | var fs = require('fs') | 6 | var fs = require('fs') |
6 | var expect = chai.expect | 7 | var expect = chai.expect |
@@ -18,16 +19,21 @@ | |||
18 | before(function (done) { | 19 | before(function (done) { |
19 | this.timeout(20000) | 20 | this.timeout(20000) |
20 | 21 | ||
21 | utils.flushTests(function () { | 22 | async.series([ |
22 | utils.runServer(1, function (app1, url1) { | 23 | function (next) { |
23 | app = app1 | 24 | utils.flushTests(next) |
24 | url = url1 | 25 | }, |
25 | 26 | function (next) { | |
26 | webtorrent.create({ host: 'client', port: '1' }, function () { | 27 | utils.runServer(1, function (app1, url1) { |
27 | done() | 28 | app = app1 |
29 | url = url1 | ||
30 | next() | ||
28 | }) | 31 | }) |
29 | }) | 32 | }, |
30 | }) | 33 | function (next) { |
34 | webtorrent.create({ host: 'client', port: '1' }, next) | ||
35 | } | ||
36 | ], done) | ||
31 | }) | 37 | }) |
32 | 38 | ||
33 | it('Should not have videos', function (done) { | 39 | it('Should not have videos', function (done) { |
@@ -132,9 +138,7 @@ | |||
132 | 138 | ||
133 | // Keep the logs if the test failed | 139 | // Keep the logs if the test failed |
134 | if (this.ok) { | 140 | if (this.ok) { |
135 | utils.flushTests(function () { | 141 | utils.flushTests(done) |
136 | done() | ||
137 | }) | ||
138 | } else { | 142 | } else { |
139 | done() | 143 | done() |
140 | } | 144 | } |