import { expect } from 'chai'
import {
cleanupTests,
- flushAndRunServer,
+ createSingleServer,
killallServers,
+ PeerTubeServer,
PluginsCommand,
- reRunServer,
- ServerInfo,
setAccessTokensToServers
} from '../../../shared/extra-utils'
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 ])
})
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)
- killallServers([ server ])
- await reRunServer(server)
+ await killallServers([ 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')
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)
- killallServers([ server ])
- await reRunServer(server)
+ await killallServers([ 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')