[CI > Test] Log stderr and stdout in script

This commit is contained in:
Ducko 2022-02-01 21:43:44 +00:00
parent 41bb80ae22
commit a82b1adb02

View file

@ -1,16 +1,21 @@
const { execFile } = require('child_process');
const test = () => {
const proc = execFile(process.argv[2], ['--enable-logging']);
const proc = execFile('xvfb-run', ['-e', '/dev/stdout', process.argv[2], '--enable-logging']);
let success = false;
proc.stderr.on('data', (data) => {
console.error(data.toString());
if (data.toString().includes('FAST CONNECT')) { // Main window JS running, startup success
success = true;
proc.kill();
}
});
data.stdout.on('data', (data) => {
console.log(data.toString();)
})
proc.on('close', async () => {
process.exit(success ? 0 : 1);
});