]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/users/users-command.ts
Add bin directory creation for parallel tests
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / users / users-command.ts
index ddd20d041805d18d4ab8c27fb644ec601ddf8cb9..2a10e4fc8d2fe3baa676bab49f56d3824d54b91e 100644 (file)
@@ -191,9 +191,9 @@ export class UsersCommand extends AbstractCommand {
     })).then(res => res.user)
   }
 
-  async generate (username: string) {
+  async generate (username: string, role?: UserRole) {
     const password = 'password'
-    const user = await this.create({ username, password })
+    const user = await this.create({ username, password, role })
 
     const token = await this.server.login.getAccessToken({ username, password })
 
@@ -206,9 +206,9 @@ export class UsersCommand extends AbstractCommand {
     }
   }
 
-  async generateUserAndToken (username: string) {
+  async generateUserAndToken (username: string, role?: UserRole) {
     const password = 'password'
-    await this.create({ username, password })
+    await this.create({ username, password, role })
 
     return this.server.login.getAccessToken({ username, password })
   }