]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/cli/peertube.ts
Move test functions outside extra-utils
[github/Chocobozzz/PeerTube.git] / server / tests / cli / peertube.ts
index f2a9849628547a11b853a35b05e13c96297a9f68..034d216e36784adc1fd0130c783dc40ab86844ed 100644 (file)
@@ -2,19 +2,17 @@
 
 import 'mocha'
 import { expect } from 'chai'
+import { areHttpImportTestsDisabled, buildAbsoluteFixturePath } from '@shared/core-utils'
 import {
-  areHttpImportTestsDisabled,
-  buildAbsoluteFixturePath,
   cleanupTests,
   CLICommand,
   createSingleServer,
   doubleFollow,
-  FIXTURE_URLS,
   PeerTubeServer,
   setAccessTokensToServers,
-  testHelloWorldRegisteredSettings,
   waitJobs
-} from '../../../shared/extra-utils'
+} from '@shared/server-commands'
+import { FIXTURE_URLS, testHelloWorldRegisteredSettings } from '../shared'
 
 describe('Test CLI wrapper', function () {
   let server: PeerTubeServer
@@ -207,6 +205,25 @@ describe('Test CLI wrapper', function () {
 
       expect(res).to.not.contain('peertube-plugin-hello-world')
     })
+
+    it('Should install a plugin in requested version', async function () {
+      this.timeout(60000)
+
+      await cliCommand.execWithEnv(`${cmd} plugins install --npm-name peertube-plugin-hello-world --plugin-version 0.0.17`)
+    })
+
+    it('Should list installed plugins, in correct version', async function () {
+      const res = await cliCommand.execWithEnv(`${cmd} plugins list`)
+
+      expect(res).to.contain('peertube-plugin-hello-world')
+      expect(res).to.contain('0.0.17')
+    })
+
+    it('Should uninstall the plugin again', async function () {
+      const res = await cliCommand.execWithEnv(`${cmd} plugins uninstall --npm-name peertube-plugin-hello-world`)
+
+      expect(res).to.not.contain('peertube-plugin-hello-world')
+    })
   })
 
   describe('Manage video redundancies', function () {