scripts: enhance logs
This commit is contained in:
parent
9b51e4fe2b
commit
6707dedb71
2 changed files with 7 additions and 2 deletions
|
|
@ -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}])
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue