diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:47:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch) | |
tree | eaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /server/tests/external-plugins/auto-block-videos.ts | |
parent | 89d241a79c262b9775c233b73cff080043ebb5e6 (diff) | |
download | PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.gz PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.zst PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.zip |
Use an object to represent a server
Diffstat (limited to 'server/tests/external-plugins/auto-block-videos.ts')
-rw-r--r-- | server/tests/external-plugins/auto-block-videos.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/server/tests/external-plugins/auto-block-videos.ts b/server/tests/external-plugins/auto-block-videos.ts index 3b4b48bf0..9cb86310b 100644 --- a/server/tests/external-plugins/auto-block-videos.ts +++ b/server/tests/external-plugins/auto-block-videos.ts | |||
@@ -5,17 +5,16 @@ import { expect } from 'chai' | |||
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
7 | doubleFollow, | 7 | doubleFollow, |
8 | flushAndRunMultipleServers, | 8 | createMultipleServers, |
9 | killallServers, | 9 | killallServers, |
10 | MockBlocklist, | 10 | MockBlocklist, |
11 | reRunServer, | 11 | PeerTubeServer, |
12 | ServerInfo, | ||
13 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
14 | wait | 13 | wait |
15 | } from '@shared/extra-utils' | 14 | } from '@shared/extra-utils' |
16 | import { Video } from '@shared/models' | 15 | import { Video } from '@shared/models' |
17 | 16 | ||
18 | async function check (server: ServerInfo, videoUUID: string, exists = true) { | 17 | async function check (server: PeerTubeServer, videoUUID: string, exists = true) { |
19 | const { data } = await server.videos.list() | 18 | const { data } = await server.videos.list() |
20 | 19 | ||
21 | const video = data.find(v => v.uuid === videoUUID) | 20 | const video = data.find(v => v.uuid === videoUUID) |
@@ -25,7 +24,7 @@ async function check (server: ServerInfo, videoUUID: string, exists = true) { | |||
25 | } | 24 | } |
26 | 25 | ||
27 | describe('Official plugin auto-block videos', function () { | 26 | describe('Official plugin auto-block videos', function () { |
28 | let servers: ServerInfo[] | 27 | let servers: PeerTubeServer[] |
29 | let blocklistServer: MockBlocklist | 28 | let blocklistServer: MockBlocklist |
30 | let server1Videos: Video[] = [] | 29 | let server1Videos: Video[] = [] |
31 | let server2Videos: Video[] = [] | 30 | let server2Videos: Video[] = [] |
@@ -34,7 +33,7 @@ describe('Official plugin auto-block videos', function () { | |||
34 | before(async function () { | 33 | before(async function () { |
35 | this.timeout(60000) | 34 | this.timeout(60000) |
36 | 35 | ||
37 | servers = await flushAndRunMultipleServers(2) | 36 | servers = await createMultipleServers(2) |
38 | await setAccessTokensToServers(servers) | 37 | await setAccessTokensToServers(servers) |
39 | 38 | ||
40 | for (const server of servers) { | 39 | for (const server of servers) { |
@@ -161,7 +160,7 @@ describe('Official plugin auto-block videos', function () { | |||
161 | await check(servers[0], video.uuid, true) | 160 | await check(servers[0], video.uuid, true) |
162 | 161 | ||
163 | await killallServers([ servers[0] ]) | 162 | await killallServers([ servers[0] ]) |
164 | await reRunServer(servers[0]) | 163 | await servers[0].run() |
165 | await wait(2000) | 164 | await wait(2000) |
166 | 165 | ||
167 | await check(servers[0], video.uuid, true) | 166 | await check(servers[0], video.uuid, true) |