diff options
Diffstat (limited to 'server/tests/plugins/plugin-helpers.ts')
-rw-r--r-- | server/tests/plugins/plugin-helpers.ts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts new file mode 100644 index 000000000..05928273f --- /dev/null +++ b/server/tests/plugins/plugin-helpers.ts | |||
@@ -0,0 +1,38 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | ||
2 | |||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | ||
5 | import { cleanupTests, flushAndRunServer, ServerInfo, waitUntilLog } from '../../../shared/extra-utils/server/servers' | ||
6 | import { getPluginTestPath, installPlugin, setAccessTokensToServers } from '../../../shared/extra-utils' | ||
7 | |||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test plugin helpers', function () { | ||
11 | let server: ServerInfo | ||
12 | |||
13 | before(async function () { | ||
14 | this.timeout(30000) | ||
15 | |||
16 | server = await flushAndRunServer(1) | ||
17 | await setAccessTokensToServers([ server ]) | ||
18 | |||
19 | await installPlugin({ | ||
20 | url: server.url, | ||
21 | accessToken: server.accessToken, | ||
22 | path: getPluginTestPath('-four') | ||
23 | }) | ||
24 | }) | ||
25 | |||
26 | it('Should have logged things', async function () { | ||
27 | await waitUntilLog(server, 'localhost:' + server.port + ' peertube-plugin-test-four', 1, false) | ||
28 | await waitUntilLog(server, 'Hello world from plugin four', 1) | ||
29 | }) | ||
30 | |||
31 | it('Should have made a query', async function () { | ||
32 | await waitUntilLog(server, `root email is admin${server.internalServerNumber}@example.com`, 1) | ||
33 | }) | ||
34 | |||
35 | after(async function () { | ||
36 | await cleanupTests([ server ]) | ||
37 | }) | ||
38 | }) | ||