mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add ability to install alpha/beta/rc plugin
This commit is contained in:
@@ -24,7 +24,13 @@ describe('Test CLI wrapper', function () {
|
||||
before(async function () {
|
||||
this.timeout(30000)
|
||||
|
||||
server = await createSingleServer(1)
|
||||
server = await createSingleServer(1, {
|
||||
rates_limit: {
|
||||
login: {
|
||||
max: 30
|
||||
}
|
||||
}
|
||||
})
|
||||
await setAccessTokensToServers([ server ])
|
||||
|
||||
await server.users.create({ username: 'user_1', password: 'super_password' })
|
||||
@@ -240,6 +246,19 @@ describe('Test CLI wrapper', function () {
|
||||
|
||||
expect(res).to.not.contain('peertube-plugin-hello-world')
|
||||
})
|
||||
|
||||
it('Should install a plugin in requested beta version', async function () {
|
||||
this.timeout(60000)
|
||||
|
||||
await cliCommand.execWithEnv(`${cmd} plugins install --npm-name peertube-plugin-hello-world --plugin-version 0.0.21-beta.1`)
|
||||
|
||||
const res = await cliCommand.execWithEnv(`${cmd} plugins list`)
|
||||
|
||||
expect(res).to.contain('peertube-plugin-hello-world')
|
||||
expect(res).to.contain('0.0.21-beta.1')
|
||||
|
||||
await cliCommand.execWithEnv(`${cmd} plugins uninstall --npm-name peertube-plugin-hello-world`)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Manage video redundancies', function () {
|
||||
|
||||
@@ -5,3 +5,4 @@ import './dns'
|
||||
import './image'
|
||||
import './markdown'
|
||||
import './request'
|
||||
import './validator'
|
||||
|
||||
32
server/tests/helpers/validator.ts
Normal file
32
server/tests/helpers/validator.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import { expect } from 'chai'
|
||||
import { isPluginStableOrUnstableVersionValid, isPluginStableVersionValid } from '@server/helpers/custom-validators/plugins'
|
||||
|
||||
describe('Validators', function () {
|
||||
|
||||
it('Should correctly check stable plugin versions', async function () {
|
||||
expect(isPluginStableVersionValid('3.4.0')).to.be.true
|
||||
expect(isPluginStableVersionValid('0.4.0')).to.be.true
|
||||
expect(isPluginStableVersionValid('0.1.0')).to.be.true
|
||||
|
||||
expect(isPluginStableVersionValid('0.1.0-beta-1')).to.be.false
|
||||
expect(isPluginStableVersionValid('hello')).to.be.false
|
||||
expect(isPluginStableVersionValid('0.x.a')).to.be.false
|
||||
})
|
||||
|
||||
it('Should correctly check unstable plugin versions', async function () {
|
||||
expect(isPluginStableOrUnstableVersionValid('3.4.0')).to.be.true
|
||||
expect(isPluginStableOrUnstableVersionValid('0.4.0')).to.be.true
|
||||
expect(isPluginStableOrUnstableVersionValid('0.1.0')).to.be.true
|
||||
|
||||
expect(isPluginStableOrUnstableVersionValid('0.1.0-beta.1')).to.be.true
|
||||
expect(isPluginStableOrUnstableVersionValid('0.1.0-alpha.45')).to.be.true
|
||||
expect(isPluginStableOrUnstableVersionValid('0.1.0-rc.45')).to.be.true
|
||||
|
||||
expect(isPluginStableOrUnstableVersionValid('hello')).to.be.false
|
||||
expect(isPluginStableOrUnstableVersionValid('0.x.a')).to.be.false
|
||||
expect(isPluginStableOrUnstableVersionValid('0.1.0-rc-45')).to.be.false
|
||||
expect(isPluginStableOrUnstableVersionValid('0.1.0-rc.45d')).to.be.false
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user