13 setAccessTokensToServers, cleanupTests
14 } from '../../../shared/extra-utils'
16 describe('Test CLI wrapper', function () {
17 let server: ServerInfo
18 const cmd = 'node ./dist/server/tools/peertube.js'
20 before(async function () {
22 server = await flushAndRunServer(1)
23 await setAccessTokensToServers([ server ])
25 await createUser({ url: server.url, accessToken: server.accessToken, username: 'user_1', password: 'super password' })
28 it('Should display no selected instance', async function () {
31 const env = getEnvCli(server)
32 const stdout = await execCLI(`${env} ${cmd} --help`)
34 expect(stdout).to.contain('selected')
37 it('Should remember the authentifying material of the user', async function () {
40 const env = getEnvCli(server)
41 await execCLI(`${env} ` + cmd + ` auth add --url ${server.url} -U user_1 -p "super password"`)
44 after(async function () {
47 await execCLI(cmd + ` auth del ${server.url}`)
49 await cleanupTests([ server ])