aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:47:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch)
treeeaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /server/tests/api/users/users.ts
parent89d241a79c262b9775c233b73cff080043ebb5e6 (diff)
downloadPeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.gz
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.zst
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.zip
Use an object to represent a server
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r--server/tests/api/users/users.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index 310136a37..6ae5410b3 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -5,11 +5,10 @@ import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/core-utils' 5import { HttpStatusCode } from '@shared/core-utils'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 flushAndRunServer, 8 createSingleServer,
9 killallServers, 9 killallServers,
10 makePutBodyRequest, 10 makePutBodyRequest,
11 reRunServer, 11 PeerTubeServer,
12 ServerInfo,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 testImage, 13 testImage,
15 waitJobs 14 waitJobs
@@ -19,7 +18,7 @@ import { AbuseState, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlayl
19const expect = chai.expect 18const expect = chai.expect
20 19
21describe('Test users', function () { 20describe('Test users', function () {
22 let server: ServerInfo 21 let server: PeerTubeServer
23 let token: string 22 let token: string
24 let userToken: string 23 let userToken: string
25 let videoId: number 24 let videoId: number
@@ -32,7 +31,7 @@ describe('Test users', function () {
32 before(async function () { 31 before(async function () {
33 this.timeout(30000) 32 this.timeout(30000)
34 33
35 server = await flushAndRunServer(1, { 34 server = await createSingleServer(1, {
36 rates_limit: { 35 rates_limit: {
37 login: { 36 login: {
38 max: 30 37 max: 30
@@ -238,7 +237,7 @@ describe('Test users', function () {
238 await server.sql.setTokenField(server.accessToken, 'refreshTokenExpiresAt', new Date().toISOString()) 237 await server.sql.setTokenField(server.accessToken, 'refreshTokenExpiresAt', new Date().toISOString())
239 238
240 await killallServers([ server ]) 239 await killallServers([ server ])
241 await reRunServer(server) 240 await server.run()
242 241
243 await server.users.getMyInfo({ expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) 242 await server.users.getMyInfo({ expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
244 }) 243 })
@@ -254,7 +253,7 @@ describe('Test users', function () {
254 await server.sql.setTokenField(server.accessToken, 'refreshTokenExpiresAt', futureDate) 253 await server.sql.setTokenField(server.accessToken, 'refreshTokenExpiresAt', futureDate)
255 254
256 await killallServers([ server ]) 255 await killallServers([ server ])
257 await reRunServer(server) 256 await server.run()
258 257
259 const res = await server.login.refreshToken({ refreshToken: server.refreshToken }) 258 const res = await server.login.refreshToken({ refreshToken: server.refreshToken })
260 server.accessToken = res.body.access_token 259 server.accessToken = res.body.access_token