From 48b7031074c1d074c1dd70176f442806a9781d37 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Tue, 22 Jul 2014 22:24:19 +0400 Subject: [PATCH] fix mocha debug mode --- test/functional/lib/startup.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/functional/lib/startup.js b/test/functional/lib/startup.js index da5b0eed9..395bb4d4a 100644 --- a/test/functional/lib/startup.js +++ b/test/functional/lib/startup.js @@ -13,6 +13,12 @@ process.express.listen(55550) module.exports.start = function start(dir, conf, cb) { rimraf(__dirname + '/../' + dir, function() { + // filter out --debug-brk + var oldArgv = process.execArgv + process.execArgv = process.execArgv.filter(function(x) { + return x !== '--debug-brk' + }) + var f = fork(__dirname + '/../../../bin/sinopia' , ['-c', __dirname + '/../' + conf] , {silent: true} @@ -21,8 +27,13 @@ module.exports.start = function start(dir, conf, cb) { f.on('message', function(msg) { if ('sinopia_started' in msg) { cb() + cb = function(){} } }) + f.on('error', function(err) { + throw err + }) + process.execArgv = oldArgv }) }