aboutsummaryrefslogtreecommitdiffstats
path: root/test/integration/index.js
blob: ab418a1468de4d53da7748be2d4f56ba9771d927 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const fs = require('fs')
const path = require('path')
const browserify = require('browserify')
const tests = fs.readdirSync(path.join(__dirname, 'lib'))
const bundlePath = path.join(__dirname, 'bundle.js')

const b = browserify()

try {
  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)
}