test - integration - better error handling

This commit is contained in:
kumavis 2017-08-03 22:24:22 -07:00
parent f804567d24
commit 0a5a46b8f4
1 changed files with 9 additions and 10 deletions

View File

@ -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) {
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)
}
})
b.bundle()
.pipe(writeStream)
.on('error', (err) => {
throw err
})