aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/plugins.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-05 16:37:50 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:16 +0200
commit329619b3453479f76c049816b7403b86e9d45cb5 (patch)
treee522940946402a4284d356f2cde8e0dcbe29b289 /server/tests/cli/plugins.ts
parenta6a79eae0d8564099b6957e76d7a18528d9ef124 (diff)
downloadPeerTube-329619b3453479f76c049816b7403b86e9d45cb5.tar.gz
PeerTube-329619b3453479f76c049816b7403b86e9d45cb5.tar.zst
PeerTube-329619b3453479f76c049816b7403b86e9d45cb5.zip
Introduce CLI command
Diffstat (limited to 'server/tests/cli/plugins.ts')
-rw-r--r--server/tests/cli/plugins.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/server/tests/cli/plugins.ts b/server/tests/cli/plugins.ts
index 7f19f14b7..efdc20748 100644
--- a/server/tests/cli/plugins.ts
+++ b/server/tests/cli/plugins.ts
@@ -1,12 +1,11 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai'
4import { 5import {
5 cleanupTests, 6 cleanupTests,
6 execCLI,
7 flushAndRunServer, 7 flushAndRunServer,
8 getConfig, 8 getConfig,
9 getEnvCli,
10 getPluginTestPath, 9 getPluginTestPath,
11 killallServers, 10 killallServers,
12 reRunServer, 11 reRunServer,
@@ -14,7 +13,6 @@ import {
14 setAccessTokensToServers 13 setAccessTokensToServers
15} from '../../../shared/extra-utils' 14} from '../../../shared/extra-utils'
16import { ServerConfig } from '../../../shared/models/server' 15import { ServerConfig } from '../../../shared/models/server'
17import { expect } from 'chai'
18 16
19describe('Test plugin scripts', function () { 17describe('Test plugin scripts', function () {
20 let server: ServerInfo 18 let server: ServerInfo
@@ -31,15 +29,13 @@ describe('Test plugin scripts', function () {
31 29
32 const packagePath = getPluginTestPath() 30 const packagePath = getPluginTestPath()
33 31
34 const env = getEnvCli(server) 32 await server.cliCommand.execWithEnv(`npm run plugin:install -- --plugin-path ${packagePath}`)
35 await execCLI(`${env} npm run plugin:install -- --plugin-path ${packagePath}`)
36 }) 33 })
37 34
38 it('Should install a theme from stateless CLI', async function () { 35 it('Should install a theme from stateless CLI', async function () {
39 this.timeout(60000) 36 this.timeout(60000)
40 37
41 const env = getEnvCli(server) 38 await server.cliCommand.execWithEnv(`npm run plugin:install -- --npm-name peertube-theme-background-red`)
42 await execCLI(`${env} npm run plugin:install -- --npm-name peertube-theme-background-red`)
43 }) 39 })
44 40
45 it('Should have the theme and the plugin registered when we restart peertube', async function () { 41 it('Should have the theme and the plugin registered when we restart peertube', async function () {
@@ -63,8 +59,7 @@ describe('Test plugin scripts', function () {
63 it('Should uninstall a plugin from stateless CLI', async function () { 59 it('Should uninstall a plugin from stateless CLI', async function () {
64 this.timeout(60000) 60 this.timeout(60000)
65 61
66 const env = getEnvCli(server) 62 await server.cliCommand.execWithEnv(`npm run plugin:uninstall -- --npm-name peertube-plugin-test`)
67 await execCLI(`${env} npm run plugin:uninstall -- --npm-name peertube-plugin-test`)
68 }) 63 })
69 64
70 it('Should have removed the plugin on another peertube restart', async function () { 65 it('Should have removed the plugin on another peertube restart', async function () {