scripts: enhance logs

This commit is contained in:
jean-emmanuel 2018-10-30 06:26:36 +01:00
parent 528607e052
commit 33c1fd716c
2 changed files with 7 additions and 2 deletions

View file

@ -25,7 +25,7 @@ var transforms = [
]
if (prod) {
console.warn('\x1b[36m%s\x1b[0m', '=> Building minified client bundle, this may take a while...')
console.warn('\033[36m=> Building minified client bundle, this may take a while...\033[0m')
transforms.push([transformWrapper(require('uglifyify')), {global: true}])
}

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)