X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Fstats.ts;h=c207bb5f00196e649e163458c62766e06d2cbab9;hb=7024e9120b381b5b3201212f5a18f5cdc14e15ff;hp=eadbcaf834844ede0f97be2270770d85fb036443;hpb=1eddc9a74f9a80fa5d0cb25fceb3fc47a1a3c14a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index eadbcaf83..c207bb5f0 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts @@ -1,23 +1,23 @@ -/* tslint:disable:no-unused-expression */ +/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import * as chai from 'chai' import 'mocha' import { ServerStats } from '../../../../shared/models/server/server-stats.model' import { + cleanupTests, createUser, doubleFollow, flushAndRunMultipleServers, follow, - killallServers, ServerInfo, uploadVideo, viewVideo, wait -} from '../../../../shared/utils' -import { flushTests, setAccessTokensToServers } from '../../../../shared/utils/index' -import { getStats } from '../../../../shared/utils/server/stats' -import { addVideoCommentThread } from '../../../../shared/utils/videos/video-comments' -import { waitJobs } from '../../../../shared/utils/server/jobs' +} from '../../../../shared/extra-utils' +import { setAccessTokensToServers } from '../../../../shared/extra-utils/index' +import { getStats } from '../../../../shared/extra-utils/server/stats' +import { addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect @@ -26,8 +26,6 @@ describe('Test stats (excluding redundancy)', function () { before(async function () { this.timeout(60000) - - await flushTests() servers = await flushAndRunMultipleServers(3) await setAccessTokensToServers(servers) @@ -37,7 +35,7 @@ describe('Test stats (excluding redundancy)', function () { username: 'user1', password: 'super_password' } - await createUser({ url: servers[ 0 ].url, accessToken: servers[ 0 ].accessToken, username: user.username, password: user.password }) + await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username: user.username, password: user.password }) const resVideo = await uploadVideo(servers[0].url, servers[0].accessToken, { fixture: 'video_short.webm' }) const videoUUID = resVideo.body.video.uuid @@ -98,6 +96,6 @@ describe('Test stats (excluding redundancy)', function () { }) after(async function () { - killallServers(servers) + await cleanupTests(servers) }) })