diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 10:33:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | ae2abfd3aed3e75d39a316b49b914d187faa7475 (patch) | |
tree | 4d5060dc310f3d8cdcd5829779522f49b3d10e71 /server/tests/plugins/plugin-unloading.ts | |
parent | 9c6327f803aaf4200672f1fc40b2f43786daca47 (diff) | |
download | PeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.tar.gz PeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.tar.zst PeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.zip |
Introduce plugins command
Diffstat (limited to 'server/tests/plugins/plugin-unloading.ts')
-rw-r--r-- | server/tests/plugins/plugin-unloading.ts | 32 |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { | ||
5 | cleanupTests, | ||
6 | flushAndRunServer, | ||
7 | getPluginTestPath, | ||
8 | makeGetRequest, | ||
9 | installPlugin, | ||
10 | uninstallPlugin, | ||
11 | ServerInfo, | ||
12 | setAccessTokensToServers | ||
13 | } from '../../../shared/extra-utils' | ||
14 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
15 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/core-utils' | ||
6 | import { cleanupTests, flushAndRunServer, makeGetRequest, PluginsCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils' | ||
16 | 7 | ||
17 | describe('Test plugins module unloading', function () { | 8 | describe('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, |