aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/plugin-unloading.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/plugins/plugin-unloading.ts')
-rw-r--r--server/tests/plugins/plugin-unloading.ts32
1 files changed, 6 insertions, 26 deletions
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 @@
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 {
5 cleanupTests,
6 flushAndRunServer,
7 getPluginTestPath,
8 makeGetRequest,
9 installPlugin,
10 uninstallPlugin,
11 ServerInfo,
12 setAccessTokensToServers
13} from '../../../shared/extra-utils'
14import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
15import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/core-utils'
6import { cleanupTests, flushAndRunServer, makeGetRequest, PluginsCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils'
16 7
17describe('Test plugins module unloading', function () { 8describe('Test plugins module unloading', function () {
18 let server: ServerInfo = null 9 let server: ServerInfo = null
@@ -25,11 +16,7 @@ describe('Test plugins module unloading', function () {
25 server = await flushAndRunServer(1) 16 server = await flushAndRunServer(1)
26 await setAccessTokensToServers([ server ]) 17 await setAccessTokensToServers([ server ])
27 18
28 await installPlugin({ 19 await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-unloading') })
29 url: server.url,
30 accessToken: server.accessToken,
31 path: getPluginTestPath('-unloading')
32 })
33 }) 20 })
34 21
35 it('Should return a numeric value', async function () { 22 it('Should return a numeric value', async function () {
@@ -54,11 +41,7 @@ describe('Test plugins module unloading', function () {
54 }) 41 })
55 42
56 it('Should uninstall the plugin and free the route', async function () { 43 it('Should uninstall the plugin and free the route', async function () {
57 await uninstallPlugin({ 44 await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-unloading' })
58 url: server.url,
59 accessToken: server.accessToken,
60 npmName: 'peertube-plugin-test-unloading'
61 })
62 45
63 await makeGetRequest({ 46 await makeGetRequest({
64 url: server.url, 47 url: server.url,
@@ -68,11 +51,8 @@ describe('Test plugins module unloading', function () {
68 }) 51 })
69 52
70 it('Should return a different numeric value', async function () { 53 it('Should return a different numeric value', async function () {
71 await installPlugin({ 54 await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-unloading') })
72 url: server.url, 55
73 accessToken: server.accessToken,
74 path: getPluginTestPath('-unloading')
75 })
76 const res = await makeGetRequest({ 56 const res = await makeGetRequest({
77 url: server.url, 57 url: server.url,
78 path: requestPath, 58 path: requestPath,