mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-04-25 06:22:24 +00:00
62 lines
1.2 KiB
JavaScript
62 lines
1.2 KiB
JavaScript
module.exports = (config) => {
|
|
const path = require('path')
|
|
const node_modules_dir = path.join(__dirname, 'node_modules')
|
|
const deps = [
|
|
'deps/forge.bundle.js'
|
|
]
|
|
config.set({
|
|
basePath: '',
|
|
frameworks: ['mocha'],
|
|
|
|
files: [
|
|
'tests/test.js'
|
|
],
|
|
|
|
preprocessors: {
|
|
'tests/*': ['webpack']
|
|
},
|
|
|
|
webpack: {
|
|
output: {
|
|
path: path.join(__dirname, 'dist'),
|
|
filename: 'bundle.js'
|
|
},
|
|
resolve: {
|
|
extensions: ['', '.js', '.json'],
|
|
alias: { 'node-forge': path.resolve(__dirname, 'deps/forge.bundle.js') }
|
|
},
|
|
externals: {
|
|
fs: '{}'
|
|
},
|
|
node: {
|
|
Buffer: true
|
|
},
|
|
module: {
|
|
loaders: [
|
|
{ test: /\.json$/, loader: 'json' }
|
|
],
|
|
noParse: []
|
|
}
|
|
},
|
|
|
|
webpackMiddleware: {
|
|
noInfo: true,
|
|
stats: {
|
|
colors: true
|
|
}
|
|
},
|
|
reporters: ['spec'],
|
|
port: 9876,
|
|
colors: true,
|
|
logLevel: config.LOG_INFO,
|
|
autoWatch: false,
|
|
browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'],
|
|
singleRun: true
|
|
})
|
|
|
|
deps.forEach((dep) => {
|
|
const depPath = path.resolve(node_modules_dir, dep)
|
|
config.webpack.module.noParse.push(depPath)
|
|
})
|
|
}
|