before(function () { this.timeout(1500000); // start the panic server panic.server(staticServer).listen(ports.panic); return waitFor(2, browsers) .then(function () { return waitFor(1, server); }); });
var config = { IP: require('ip').address(), port: 8080, servers: 2, browsers: 2, route: { '/': __dirname + '/index.html', '/gun.js': __dirname + '/../../gun.js', '/jquery.js': __dirname + '/../../examples/jquery.js', '/cryptomodules.js': __dirname + '/../../lib/cryptomodules.js', '/sea.js': __dirname + '/../../sea.js' } } var panic = require('panic-server'); panic.server().on('request', function(req, res){ config.route[req.url] && require('fs').createReadStream(config.route[req.url]).pipe(res); }).listen(config.port); var clients = panic.clients; var manager = require('panic-manager')(); manager.start({ clients: Array(config.servers).fill().map(function(u, i){ return { type: 'node', port: config.port + (i + 1) } }), panic: 'http://' + config.IP + ':' + config.port });