mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Add SQL query support in plugins
This commit is contained in:
parent
bc0d801bb7
commit
1b05d82d86
10 changed files with 110 additions and 9 deletions
38
server/tests/plugins/plugin-helpers.ts
Normal file
38
server/tests/plugins/plugin-helpers.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import * as chai from 'chai'
|
||||
import 'mocha'
|
||||
import { cleanupTests, flushAndRunServer, ServerInfo, waitUntilLog } from '../../../shared/extra-utils/server/servers'
|
||||
import { getPluginTestPath, installPlugin, setAccessTokensToServers } from '../../../shared/extra-utils'
|
||||
|
||||
const expect = chai.expect
|
||||
|
||||
describe('Test plugin helpers', function () {
|
||||
let server: ServerInfo
|
||||
|
||||
before(async function () {
|
||||
this.timeout(30000)
|
||||
|
||||
server = await flushAndRunServer(1)
|
||||
await setAccessTokensToServers([ server ])
|
||||
|
||||
await installPlugin({
|
||||
url: server.url,
|
||||
accessToken: server.accessToken,
|
||||
path: getPluginTestPath('-four')
|
||||
})
|
||||
})
|
||||
|
||||
it('Should have logged things', async function () {
|
||||
await waitUntilLog(server, 'localhost:' + server.port + ' peertube-plugin-test-four', 1, false)
|
||||
await waitUntilLog(server, 'Hello world from plugin four', 1)
|
||||
})
|
||||
|
||||
it('Should have made a query', async function () {
|
||||
await waitUntilLog(server, `root email is admin${server.internalServerNumber}@example.com`, 1)
|
||||
})
|
||||
|
||||
after(async function () {
|
||||
await cleanupTests([ server ])
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue