Skip to content

Commit

Permalink
Merge pull request #103 from stakedotlink/test-script-error-handilng
Browse files Browse the repository at this point in the history
test script error handling
  • Loading branch information
jleeh authored May 6, 2024
2 parents 84216ee + b44949d commit 3ad330d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion scripts/test/start-test-envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ async function compile() {
console.log('yarn compile - process (' + child.pid + '): ' + data)
})

child.stderr.on('data', (data) => {
console.error('yarn compile - process (' + child.pid + ') (stderr): ' + data)
})

return await new Promise((resolve) => {
child.on('close', () => {
resolve('success')
Expand All @@ -20,7 +24,11 @@ async function startHardhat() {
const child = child_process.spawn('npx', ['yarn', 'start'])

child.stdout.on('data', (data) => {
console.log('yarn compile - process (' + child.pid + '): ' + data)
console.log('yarn start - process (' + child.pid + '): ' + data)
})

child.stderr.on('data', (data) => {
console.error('yarn start - process (' + child.pid + ') (stderr): ' + data)
})

return await new Promise((resolve) => {
Expand All @@ -39,6 +47,10 @@ async function deploy() {
console.log('yarn deploy - process (' + child.pid + '): ' + data)
})

child.stderr.on('data', (data) => {
console.error('yarn deploy - process (' + child.pid + ') (stderr): ' + data)
})

return await new Promise((resolve) => {
child.on('close', () => {
resolve('success')
Expand All @@ -53,6 +65,10 @@ async function testnEnv() {
console.log('yarn setup-test-env - process (' + child.pid + '): ' + data)
})

child.stderr.on('data', (data) => {
console.error('yarn setup-test-env - process (' + child.pid + ') (stderr): ' + data)
})

return await new Promise((resolve) => {
child.on('close', () => {
resolve('success')
Expand Down

0 comments on commit 3ad330d

Please sign in to comment.