X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fplugins%2Fplugin-unloading.ts;h=a94b836950b9f339c952b135d6994e5fa8e14ca3;hb=10a72a7e617273cdbe897766f77f427eb57b689a;hp=26a27abcae63863360ae2df2508ea09066871994;hpb=89d241a79c262b9775c233b73cff080043ebb5e6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/plugins/plugin-unloading.ts b/server/tests/plugins/plugin-unloading.ts index 26a27abca..a94b83695 100644 --- a/server/tests/plugins/plugin-unloading.ts +++ b/server/tests/plugins/plugin-unloading.ts @@ -2,18 +2,25 @@ import 'mocha' import { expect } from 'chai' -import { HttpStatusCode } from '@shared/core-utils' -import { cleanupTests, flushAndRunServer, makeGetRequest, PluginsCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils' +import { + cleanupTests, + createSingleServer, + makeGetRequest, + PeerTubeServer, + PluginsCommand, + setAccessTokensToServers +} from '@shared/server-commands' +import { HttpStatusCode } from '@shared/models' describe('Test plugins module unloading', function () { - let server: ServerInfo = null + let server: PeerTubeServer = null const requestPath = '/plugins/test-unloading/router/get' let value: string = null before(async function () { this.timeout(30000) - server = await flushAndRunServer(1) + server = await createSingleServer(1) await setAccessTokensToServers([ server ]) await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-unloading') }) @@ -23,7 +30,7 @@ describe('Test plugins module unloading', function () { const res = await makeGetRequest({ url: server.url, path: requestPath, - statusCodeExpected: HttpStatusCode.OK_200 + expectedStatus: HttpStatusCode.OK_200 }) expect(res.body.message).to.match(/^\d+$/) @@ -34,7 +41,7 @@ describe('Test plugins module unloading', function () { const res = await makeGetRequest({ url: server.url, path: requestPath, - statusCodeExpected: HttpStatusCode.OK_200 + expectedStatus: HttpStatusCode.OK_200 }) expect(res.body.message).to.be.equal(value) @@ -46,7 +53,7 @@ describe('Test plugins module unloading', function () { await makeGetRequest({ url: server.url, path: requestPath, - statusCodeExpected: HttpStatusCode.NOT_FOUND_404 + expectedStatus: HttpStatusCode.NOT_FOUND_404 }) }) @@ -56,7 +63,7 @@ describe('Test plugins module unloading', function () { const res = await makeGetRequest({ url: server.url, path: requestPath, - statusCodeExpected: HttpStatusCode.OK_200 + expectedStatus: HttpStatusCode.OK_200 }) expect(res.body.message).to.match(/^\d+$/)