aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/mock-servers/joinpeertube-versions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/mock-servers/joinpeertube-versions.ts')
-rw-r--r--shared/extra-utils/mock-servers/joinpeertube-versions.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/shared/extra-utils/mock-servers/joinpeertube-versions.ts b/shared/extra-utils/mock-servers/joinpeertube-versions.ts
index d7d5b2c49..5ea432ecf 100644
--- a/shared/extra-utils/mock-servers/joinpeertube-versions.ts
+++ b/shared/extra-utils/mock-servers/joinpeertube-versions.ts
@@ -1,10 +1,11 @@
1import * as express from 'express' 1import * as express from 'express'
2import { randomInt } from '@shared/core-utils'
2 3
3export class MockJoinPeerTubeVersions { 4export class MockJoinPeerTubeVersions {
4 private latestVersion: string 5 private latestVersion: string
5 6
6 initialize () { 7 initialize () {
7 return new Promise<void>(res => { 8 return new Promise<number>(res => {
8 const app = express() 9 const app = express()
9 10
10 app.use('/', (req: express.Request, res: express.Response, next: express.NextFunction) => { 11 app.use('/', (req: express.Request, res: express.Response, next: express.NextFunction) => {
@@ -21,7 +22,8 @@ export class MockJoinPeerTubeVersions {
21 }) 22 })
22 }) 23 })
23 24
24 app.listen(42102, () => res()) 25 const port = 42201 + randomInt(1, 100)
26 app.listen(port, () => res(port))
25 }) 27 })
26 } 28 }
27 29