|
|
|
@ -2,8 +2,18 @@ var connect = require('connect');
@@ -2,8 +2,18 @@ var connect = require('connect');
|
|
|
|
|
var serveStatic = require('serve-static'); |
|
|
|
|
var open = require('open'); |
|
|
|
|
var path = require('path'); |
|
|
|
|
var child_process = require('child_process'); |
|
|
|
|
|
|
|
|
|
connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071, function() { |
|
|
|
|
var server = connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071, function() { |
|
|
|
|
if (process.argv.indexOf('--phantomjs') !== -1) { |
|
|
|
|
child_process.spawn('node_modules/.bin/mocha-phantomjs', ['http://localhost:8071/tests/tests.html'], { |
|
|
|
|
stdio: 'inherit' |
|
|
|
|
}).on('exit', function () { |
|
|
|
|
server.close(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
open('http://localhost:8071/tests/tests.html'); |
|
|
|
|
console.log('Serving tests...'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|