diff --git a/lib/jasmine-node/runner.js b/lib/jasmine-node/runner.js index dddb2e6..93527dc 100644 --- a/lib/jasmine-node/runner.js +++ b/lib/jasmine-node/runner.js @@ -19,7 +19,7 @@ autoTest = require('./auto-test'); minimistOpts = { - boolean: ["autoTest", "captureExceptions", "coffee", "debug", "forceColor", "growl", "h", "help", "junit", "nunit", "matchAll", "noColor", "noStackTrace", "verbose", "version"], + boolean: ["autoTest", "captureExceptions", "coffee", "debug", "forceColor", "growl", "h", "help", "junit", "nunit", "matchAll", "noColor", "noStackTrace", "verbose", "version", "forceExit"], string: ["reporterConfig", "m", "match", "watchFolders"], alias: { match: "m", @@ -55,7 +55,27 @@ }; help = function() { - process.stdout.write("USAGE: jasmine-node [--color|--noColor] [--verbose] [--coffee] directory\n\nOptions:\n --autoTest - rerun automatically the specs when a file changes\n --captureExceptions - listen to global exceptions, report them and exit (interferes with Domains)\n --coffee - load coffee-script which allows execution .coffee files\n --growl - display test run summary in a growl notification (in addition to other outputs)\n --help, -h - display this help and exit\n --junit - use the junit reporter\n --match, -m REGEXP - load only specs containing \"REGEXPspec\"\n --matchAll - relax requirement of \"spec\" in spec file names\n --noColor - do not use color coding for output\n --noStackTrace - suppress the stack trace generated from a test failure\n --nunit - use the nunit reporter\n --reporterConfig - configuration json file to use with jasmine-reporters [nunit, junit]\n --verbose - print extra information per each test run\n --version - show the current version\n --watch PATH - when used with --autoTest, watches the given path(s) and runs all tests if a change is detected"); + process.stdout.write( + "USAGE: jasmine-node [--color|--noColor] [--verbose] [--coffee] directory\n\n"+ + "Options:\n"+ + " --autoTest - rerun automatically the specs when a file changes\n"+ + " --captureExceptions - listen to global exceptions, report them and exit (interferes with Domains)\n"+ + " --coffee - load coffee-script which allows execution .coffee files\n"+ + " --growl - display test run summary in a growl notification (in addition to other outputs)\n"+ + " --help, -h - display this help and exit\n"+ + " --junit - use the junit reporter\n"+ + " --match, -m REGEXP - load only specs containing \"REGEXPspec\"\n"+ + " --matchAll - relax requirement of \"spec\" in spec file names\n"+ + " --noColor - do not use color coding for output\n"+ + " --noStackTrace - suppress the stack trace generated from a test failure\n"+ + " --nunit - use the nunit reporter\n"+ + " --reporterConfig - configuration json file to use with jasmine-reporters [nunit, junit]\n"+ + " --forceExit - force exit once tests complete.\n"+ + " --verbose - print extra information per each test run\n"+ + " --version - show the current version\n"+ + " --watch PATH - when used with --autoTest, watches the given path(s) and runs all tests if a change is detected\n" + ); + process.exit(-1); }; @@ -118,6 +138,13 @@ if (_.isEmpty(options.specFolders)) { help(); } + + if (options.forceExit) { + options.onComplete=function() { + process.exit(0); + } + } + return options; }; diff --git a/package.json b/package.json index 65b0bb0..7bd9e65 100755 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "jasmine-growl-reporter": "~0.2.0", "xml2js": "~0.4.1", "grunt-exec": "~0.4.5", - "jasmine-reporters": "git://github.com/larrymyers/jasmine-reporters.git#2c7242dc11c15c2f156169bc704798568b8cb50d" + "jasmine-reporters": "git+https://github.com/larrymyers/jasmine-reporters.git#2c7242dc11c15c2f156169bc704798568b8cb50d" }, "devDependencies": { "grunt-contrib-coffee": "~0.10.1",