scripts: enhance logs

This commit is contained in:
jean-emmanuel 2018-10-30 06:26:36 +01:00
parent 9b51e4fe2b
commit 6707dedb71
2 changed files with 7 additions and 2 deletions

View file

@ -30,13 +30,18 @@ function std(data){
if (data.includes('process error')) {
console.error(data.toString())
console.log('\033[31m\n=> Test errored ✘\n\033[0m')
end()
}
}
// timeout after 5s -> no error
setTimeout(end, 5000)
setTimeout(()=>{
console.log('\033[36m\n=> Test timeout without error ✔\n\033[0m')
end()
}, 5000)
function end(fail){
process.kill(-proc.pid)