1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Tests directories refractor

This commit is contained in:
Chocobozzz 2017-12-28 13:59:22 +01:00
parent db799da3d2
commit c5d31dba56
No known key found for this signature in database
GPG key ID: 583A612D890159BE
38 changed files with 98 additions and 95 deletions

View file

@ -0,0 +1,24 @@
import { exec } from 'child_process'
import { ServerInfo } from '../server/servers'
function getEnvCli (server?: ServerInfo) {
return `NODE_ENV=test NODE_APP_INSTANCE=${server.serverNumber}`
}
async function execCLI (command: string) {
return new Promise<string>((res, rej) => {
exec(command, (err, stdout, stderr) => {
if (err) return rej(err)
return res(stdout)
})
})
}
// ---------------------------------------------------------------------------
export {
execCLI,
getEnvCli
}