]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/plugin-storage.ts
Fix server run
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / plugin-storage.ts
index 9babfc83e0d1a141329a3c89102a6e84d6a92786..5745914a53b280e920f2ff402513be75ca630838 100644 (file)
@@ -5,24 +5,31 @@ import { expect } from 'chai'
 import { pathExists, readdir, readFile } from 'fs-extra'
 import { join } from 'path'
 import { HttpStatusCode } from '@shared/core-utils'
-import { cleanupTests, flushAndRunServer, makeGetRequest, PluginsCommand, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils'
+import {
+  cleanupTests,
+  createSingleServer,
+  makeGetRequest,
+  PeerTubeServer,
+  PluginsCommand,
+  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 server.serversCommand.waitUntilLog('superkey stored value is toto')
+      await server.servers.waitUntilLog('superkey stored value is toto')
     })
   })
 
@@ -38,12 +45,12 @@ describe('Test plugin storage', function () {
     }
 
     before(function () {
-      dataPath = server.serversCommand.buildDirectory('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 = server.serversCommand.buildDirectory('plugins/data')
+      const dataPath = server.servers.buildDirectory('plugins/data')
       const pluginDataPath = join(dataPath, 'peertube-plugin-test-six')
 
       expect(await pathExists(dataPath)).to.be.true
@@ -64,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')