X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fcli%2Fplugins.ts;h=cd9f4e1c3ea7c61b2d0384efa94966450970ed4a;hb=927fa4b11f692174d6296aa096d7a74bacdeea8b;hp=5344bfc96e9e8cd6e702a5b033f0446ff0d9b008;hpb=9293139fde7091e9badcafa9b570b83cea9a10ad;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/cli/plugins.ts b/server/tests/cli/plugins.ts index 5344bfc96..cd9f4e1c3 100644 --- a/server/tests/cli/plugins.ts +++ b/server/tests/cli/plugins.ts @@ -4,21 +4,20 @@ import 'mocha' import { expect } from 'chai' import { cleanupTests, - flushAndRunServer, + createSingleServer, killallServers, + PeerTubeServer, PluginsCommand, - reRunServer, - ServerInfo, setAccessTokensToServers -} from '../../../shared/extra-utils' +} from '@shared/server-commands' describe('Test plugin scripts', function () { - let server: ServerInfo + let server: PeerTubeServer before(async function () { this.timeout(30000) - server = await flushAndRunServer(1) + server = await createSingleServer(1) await setAccessTokensToServers([ server ]) }) @@ -27,22 +26,22 @@ describe('Test plugin scripts', function () { const packagePath = PluginsCommand.getPluginTestPath() - await server.cliCommand.execWithEnv(`npm run plugin:install -- --plugin-path ${packagePath}`) + await server.cli.execWithEnv(`npm run plugin:install -- --plugin-path ${packagePath}`) }) it('Should install a theme from stateless CLI', async function () { this.timeout(60000) - await server.cliCommand.execWithEnv(`npm run plugin:install -- --npm-name peertube-theme-background-red`) + await server.cli.execWithEnv(`npm run plugin:install -- --npm-name peertube-theme-background-red`) }) it('Should have the theme and the plugin registered when we restart peertube', async function () { this.timeout(30000) await killallServers([ server ]) - await reRunServer(server) + await server.run() - const config = await server.configCommand.getConfig() + const config = await server.config.getConfig() const plugin = config.plugin.registered .find(p => p.name === 'test') @@ -56,16 +55,16 @@ describe('Test plugin scripts', function () { it('Should uninstall a plugin from stateless CLI', async function () { this.timeout(60000) - await server.cliCommand.execWithEnv(`npm run plugin:uninstall -- --npm-name peertube-plugin-test`) + await server.cli.execWithEnv(`npm run plugin:uninstall -- --npm-name peertube-plugin-test`) }) it('Should have removed the plugin on another peertube restart', async function () { this.timeout(30000) await killallServers([ server ]) - await reRunServer(server) + await server.run() - const config = await server.configCommand.getConfig() + const config = await server.config.getConfig() const plugin = config.plugin.registered .find(p => p.name === 'test')