From ee5618967c91ec3b55407a6b19e988c03e7dde58 Mon Sep 17 00:00:00 2001 From: Mikael Lindqvist Date: Tue, 14 Oct 2014 10:26:52 +0200 Subject: [PATCH 1/2] use git+https: rather than git: in order to be tolerant to corporate firewalls --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From f418455072072f2b67070ba8728a47cd0e8cda67 Mon Sep 17 00:00:00 2001 From: Mikael Lindqvist Date: Tue, 14 Oct 2014 10:47:04 +0200 Subject: [PATCH 2/2] accept forceExit option --- lib/jasmine-node/runner.js | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) 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; };