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-router.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-router.ts')
-rw-r--r-- | server/tests/plugins/plugin-router.ts | 27 |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../shared/extra-utils/server/servers' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/core-utils' | ||
5 | import { | 6 | import { |
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, |
12 | import { expect } from 'chai' | 13 | setAccessTokensToServers |
13 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | 14 | } from '@shared/extra-utils' |
14 | 15 | ||
15 | describe('Test plugin helpers', function () { | 16 | describe('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({ |