X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Flogs.ts;h=f9d96bcc0785089cc428ec7979c1f4aa5804ee46;hb=d7a25329f9e607894d29ab342b9cb66638b56dc0;hp=d6a40da61001b4c11cb3f3dbaf3b3086884c9da7;hpb=fd8710b897a67518d3a61c319e54b6a65ba443ef;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/logs.ts b/server/tests/api/check-params/logs.ts index d6a40da61..f9d96bcc0 100644 --- a/server/tests/api/check-params/logs.ts +++ b/server/tests/api/check-params/logs.ts @@ -6,12 +6,13 @@ import { createUser, flushTests, killallServers, - runServer, + flushAndRunServer, ServerInfo, setAccessTokensToServers, - userLogin -} from '../../../../shared/utils' -import { makeGetRequest } from '../../../../shared/utils/requests/requests' + userLogin, + cleanupTests +} from '../../../../shared/extra-utils' +import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests' describe('Test logs API validators', function () { const path = '/api/v1/server/logs' @@ -23,9 +24,7 @@ describe('Test logs API validators', function () { before(async function () { this.timeout(120000) - await flushTests() - - server = await runServer(1) + server = await flushAndRunServer(1) await setAccessTokensToServers([ server ]) @@ -33,7 +32,7 @@ describe('Test logs API validators', function () { username: 'user1', password: 'my super password' } - await createUser(server.url, server.accessToken, user.username, user.password) + await createUser({ url: server.url, accessToken: server.accessToken, username: user.username, password: user.password }) userAccessToken = await userLogin(server, user) }) @@ -107,11 +106,6 @@ describe('Test logs API validators', function () { }) after(async function () { - killallServers([ server ]) - - // Keep the logs if the test failed - if (this['ok']) { - await flushTests() - } + await cleanupTests([ server ]) }) })