import { ChildProcess, exec, fork } from 'child_process'
import { join } from 'path'
import { root, wait } from '../miscs/miscs'
import { copy, pathExists, readdir, readFile, remove } from 'fs-extra'
import { ChildProcess, exec, fork } from 'child_process'
import { join } from 'path'
import { root, wait } from '../miscs/miscs'
import { copy, pathExists, readdir, readFile, remove } from 'fs-extra'
import { expect } from 'chai'
import { VideoChannel } from '../../models/videos'
import { randomInt } from '../../core-utils/miscs/miscs'
interface ServerInfo {
import { expect } from 'chai'
import { VideoChannel } from '../../models/videos'
import { randomInt } from '../../core-utils/miscs/miscs'
interface ServerInfo {
- if (key === 'client_id') server.client.id = matches[ 1 ]
- else if (key === 'client_secret') server.client.secret = matches[ 1 ]
- else if (key === 'user_username') server.user.username = matches[ 1 ]
- else if (key === 'user_password') server.user.password = matches[ 1 ]
+ if (key === 'client_id') server.client.id = matches[1]
+ else if (key === 'client_secret') server.client.secret = matches[1]
+ else if (key === 'user_username') server.user.username = matches[1]
+ else if (key === 'user_password') server.user.password = matches[1]
- if (data.toString().indexOf(key) !== -1) serverRunString[ key ] = true
- if (serverRunString[ key ] === false) dontContinue = true
+ if (data.toString().indexOf(key) !== -1) serverRunString[key] = true
+ if (serverRunString[key] === false) dontContinue = true
-async function waitUntilLog (server: ServerInfo, str: string, count = 1) {
+async function waitUntilLog (server: ServerInfo, str: string, count = 1, strictCount = true) {
const matches = buf.toString().match(new RegExp(str, 'g'))
if (matches && matches.length === count) return
const matches = buf.toString().match(new RegExp(str, 'g'))
if (matches && matches.length === count) return