X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Fplugins.ts;h=a0e9db1d3c840ea7dac7c824362936bdfb22cb76;hb=6a9b3151822461a85bbc72b7a50e12ffb69bec3a;hp=8ac7023ebc47f4fab5cbe7cab55d46384023ceb9;hpb=863477173efa82a4412d2e522aa46462249f9199;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.ts index 8ac7023eb..a0e9db1d3 100644 --- a/server/tests/api/server/plugins.ts +++ b/server/tests/api/server/plugins.ts @@ -3,7 +3,7 @@ import { expect } from 'chai' import { pathExists, remove } from 'fs-extra' import { join } from 'path' -import { testHelloWorldRegisteredSettings } from '@server/tests/shared' +import { SQLCommand, testHelloWorldRegisteredSettings } from '@server/tests/shared' import { wait } from '@shared/core-utils' import { HttpStatusCode, PluginType } from '@shared/models' import { @@ -17,7 +17,8 @@ import { } from '@shared/server-commands' describe('Test plugins', function () { - let server: PeerTubeServer = null + let server: PeerTubeServer + let sqlCommand: SQLCommand let command: PluginsCommand before(async function () { @@ -32,6 +33,8 @@ describe('Test plugins', function () { await setAccessTokensToServers([ server ]) command = server.plugins + + sqlCommand = new SQLCommand(server) }) it('Should list and search available plugins and themes', async function () { @@ -186,8 +189,6 @@ describe('Test plugins', function () { }) it('Should have watched settings changes', async function () { - this.timeout(10000) - await server.servers.waitUntilLog('Settings changed!') }) @@ -236,7 +237,7 @@ describe('Test plugins', function () { async function testUpdate (type: 'plugin' | 'theme', name: string) { // Fake update our plugin version - await server.sql.setPluginVersion(name, '0.0.1') + await sqlCommand.setPluginVersion(name, '0.0.1') // Fake update package.json const packageJSON = await command.getPackageJSON(`peertube-${type}-${name}`) @@ -366,7 +367,7 @@ describe('Test plugins', function () { }) const query = `UPDATE "application" SET "nodeABIVersion" = 1` - await server.sql.updateQuery(query) + await sqlCommand.updateQuery(query) const baseNativeModule = server.servers.buildDirectory(join('plugins', 'node_modules', 'a-native-example')) @@ -401,6 +402,8 @@ describe('Test plugins', function () { }) after(async function () { + await sqlCommand.cleanup() + await cleanupTests([ server ]) }) })