From 0a5a46b8f40d6f52a96f0fee96f271dd66a506ab Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 3 Aug 2017 22:24:22 -0700 Subject: [PATCH] test - integration - better error handling --- test/integration/index.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/test/integration/index.js b/test/integration/index.js index ab418a146..e089fc39b 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -6,15 +6,14 @@ const bundlePath = path.join(__dirname, 'bundle.js') const b = browserify() -try { - const writeStream = fs.createWriteStream(bundlePath) +const writeStream = fs.createWriteStream(bundlePath) - tests.forEach(function (fileName) { - b.add(path.join(__dirname, 'lib', fileName)) - }) - - b.bundle().pipe(writeStream) -} catch (err) { - throw new Error('Integration tests build failure - ' + err.stack) -} +tests.forEach(function (fileName) { + b.add(path.join(__dirname, 'lib', fileName)) +}) +b.bundle() +.pipe(writeStream) +.on('error', (err) => { + throw err +})