aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/plugin-router.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-07 10:33:49 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commitae2abfd3aed3e75d39a316b49b914d187faa7475 (patch)
tree4d5060dc310f3d8cdcd5829779522f49b3d10e71 /server/tests/plugins/plugin-router.ts
parent9c6327f803aaf4200672f1fc40b2f43786daca47 (diff)
downloadPeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.tar.gz
PeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.tar.zst
PeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.zip
Introduce plugins command
Diffstat (limited to 'server/tests/plugins/plugin-router.ts')
-rw-r--r--server/tests/plugins/plugin-router.ts27
1 files changed, 10 insertions, 17 deletions
diff --git a/server/tests/plugins/plugin-router.ts b/server/tests/plugins/plugin-router.ts
index 24e6a1e83..81e18dabd 100644
--- a/server/tests/plugins/plugin-router.ts
+++ b/server/tests/plugins/plugin-router.ts
@@ -1,16 +1,17 @@
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 { cleanupTests, flushAndRunServer, ServerInfo } from '../../../shared/extra-utils/server/servers' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/core-utils'
5import { 6import {
6 getPluginTestPath, 7 cleanupTests,
7 installPlugin, 8 flushAndRunServer,
8 makeGetRequest, 9 makeGetRequest,
9 makePostBodyRequest, 10 makePostBodyRequest,
10 setAccessTokensToServers, uninstallPlugin 11 PluginsCommand,
11} from '../../../shared/extra-utils' 12 ServerInfo,
12import { expect } from 'chai' 13 setAccessTokensToServers
13import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' 14} from '@shared/extra-utils'
14 15
15describe('Test plugin helpers', function () { 16describe('Test plugin helpers', function () {
16 let server: ServerInfo 17 let server: ServerInfo
@@ -25,11 +26,7 @@ describe('Test plugin helpers', function () {
25 server = await flushAndRunServer(1) 26 server = await flushAndRunServer(1)
26 await setAccessTokensToServers([ server ]) 27 await setAccessTokensToServers([ server ])
27 28
28 await installPlugin({ 29 await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-five') })
29 url: server.url,
30 accessToken: server.accessToken,
31 path: getPluginTestPath('-five')
32 })
33 }) 30 })
34 31
35 it('Should answer "pong"', async function () { 32 it('Should answer "pong"', async function () {
@@ -85,11 +82,7 @@ describe('Test plugin helpers', function () {
85 }) 82 })
86 83
87 it('Should remove the plugin and remove the routes', async function () { 84 it('Should remove the plugin and remove the routes', async function () {
88 await uninstallPlugin({ 85 await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-five' })
89 url: server.url,
90 accessToken: server.accessToken,
91 npmName: 'peertube-plugin-test-five'
92 })
93 86
94 for (const path of basePaths) { 87 for (const path of basePaths) {
95 await makeGetRequest({ 88 await makeGetRequest({