Skip to content
Snippets Groups Projects
Commit 4e9d6bda authored by Jed Parsons's avatar Jed Parsons
Browse files

added test filter option for use from shell

parent db579781
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,9 @@ if (!process.env['WHAT_TESTS']) {
if (whatTests[0] == 'all') whatTests = [ 'back_mysql', 'back', 'front' ];
var ec = 0;
var frontend_test_filter = process.env['FRONTEND_TEST_FILTER'] ?
' (filter: ' + process.env['FRONTEND_TEST_FILTER'] + ')' :
'';
function run() {
if (!whatTests.length) process.exit(ec);
......@@ -29,7 +32,7 @@ function run() {
const availConf = {
front: {
what: "Front end unit tests under PhantomJS",
what: "Front end unit tests under PhantomJS" + frontend_test_filter,
node_env: 'test_json',
script: 'test_frontend'
},
......
......@@ -35,8 +35,10 @@ start_stop.addStartupBatches(suite);
suite.addBatch({
"frontend unit tests": {
topic: function() {
var filter = process.env['FRONTEND_TEST_FILTER'] ?
'?filter=' + process.env['FRONTEND_TEST_FILTER'] : '';
var kid = spawn('phantomjs', [ path.join(__dirname, 'phantomrunner.js'),
'http://127.0.0.1:10002/test' ]);
'http://127.0.0.1:10002/test/'+filter ]);
kid.stdout.on('data', function(d) { process.stdout.write(d); });
kid.stderr.on('data', function(d) { process.stderr.write(d); });
kid.on('exit', this.callback);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment