X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fplugins%2Fplugin-unloading.ts;h=f430f82b82f8f79c372c1604d77a5c76f04f8f2f;hb=41d1d075011174e73dccb74006181a92a618d7b4;hp=74ca82e2f23f0ad878f55337a1c23c12cbbbfb0b;hpb=41137192096590b171563bc3161ede6f5c1d15db;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/plugins/plugin-unloading.ts b/server/tests/plugins/plugin-unloading.ts index 74ca82e2f..f430f82b8 100644 --- a/server/tests/plugins/plugin-unloading.ts +++ b/server/tests/plugins/plugin-unloading.ts @@ -1,18 +1,9 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' -import { - cleanupTests, - flushAndRunServer, - getPluginTestPath, - makeGetRequest, - installPlugin, - uninstallPlugin, - ServerInfo, - setAccessTokensToServers -} from '../../../shared/extra-utils' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' import { expect } from 'chai' +import { HttpStatusCode } from '@shared/core-utils' +import { cleanupTests, flushAndRunServer, makeGetRequest, PluginsCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils' describe('Test plugins module unloading', function () { let server: ServerInfo = null @@ -25,11 +16,7 @@ describe('Test plugins module unloading', function () { server = await flushAndRunServer(1) await setAccessTokensToServers([ server ]) - await installPlugin({ - url: server.url, - accessToken: server.accessToken, - path: getPluginTestPath('-unloading') - }) + await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-unloading') }) }) it('Should return a numeric value', async function () { @@ -54,11 +41,7 @@ describe('Test plugins module unloading', function () { }) it('Should uninstall the plugin and free the route', async function () { - await uninstallPlugin({ - url: server.url, - accessToken: server.accessToken, - npmName: 'peertube-plugin-test-unloading' - }) + await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-unloading' }) await makeGetRequest({ url: server.url, @@ -68,11 +51,8 @@ describe('Test plugins module unloading', function () { }) it('Should return a different numeric value', async function () { - await installPlugin({ - url: server.url, - accessToken: server.accessToken, - path: getPluginTestPath('-unloading') - }) + await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-unloading') }) + const res = await makeGetRequest({ url: server.url, path: requestPath,