X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fplugins%2Fplugin-storage.ts;h=5745914a53b280e920f2ff402513be75ca630838;hb=08642a765ea514a00f159db898edf14c376fbe6c;hp=4c65463f26cf759c5b52d0de880dba880697ce99;hpb=ae2abfd3aed3e75d39a316b49b914d187faa7475;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/plugins/plugin-storage.ts b/server/tests/plugins/plugin-storage.ts index 4c65463f2..5745914a5 100644 --- a/server/tests/plugins/plugin-storage.ts +++ b/server/tests/plugins/plugin-storage.ts @@ -6,32 +6,30 @@ import { pathExists, readdir, readFile } from 'fs-extra' import { join } from 'path' import { HttpStatusCode } from '@shared/core-utils' import { - buildServerDirectory, cleanupTests, - flushAndRunServer, + createSingleServer, makeGetRequest, + PeerTubeServer, PluginsCommand, - ServerInfo, - setAccessTokensToServers, - waitUntilLog + setAccessTokensToServers } from '@shared/extra-utils' describe('Test plugin storage', function () { - let server: ServerInfo + let server: PeerTubeServer before(async function () { this.timeout(30000) - server = await flushAndRunServer(1) + server = await createSingleServer(1) await setAccessTokensToServers([ server ]) - await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-six') }) + await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-six') }) }) describe('DB storage', function () { it('Should correctly store a subkey', async function () { - await waitUntilLog(server, 'superkey stored value is toto') + await server.servers.waitUntilLog('superkey stored value is toto') }) }) @@ -47,12 +45,12 @@ describe('Test plugin storage', function () { } before(function () { - dataPath = buildServerDirectory(server, 'plugins/data') + dataPath = server.servers.buildDirectory('plugins/data') pluginDataPath = join(dataPath, 'peertube-plugin-test-six') }) it('Should have created the directory on install', async function () { - const dataPath = buildServerDirectory(server, 'plugins/data') + const dataPath = server.servers.buildDirectory('plugins/data') const pluginDataPath = join(dataPath, 'peertube-plugin-test-six') expect(await pathExists(dataPath)).to.be.true @@ -73,14 +71,14 @@ describe('Test plugin storage', function () { }) it('Should still have the file after an uninstallation', async function () { - await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-six' }) + await server.plugins.uninstall({ npmName: 'peertube-plugin-test-six' }) const content = await getFileContent() expect(content).to.equal('Prince Ali') }) it('Should still have the file after the reinstallation', async function () { - await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-six') }) + await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-six') }) const content = await getFileContent() expect(content).to.equal('Prince Ali')