diff --git a/lib/jasmine-node/jasmine-loader.js b/lib/jasmine-node/jasmine-loader.js index 6f86a56..62b9d09 100644 --- a/lib/jasmine-node/jasmine-loader.js +++ b/lib/jasmine-node/jasmine-loader.js @@ -124,7 +124,7 @@ }; executeSpecsInFolder = function(options) { - var defaults, error, jasmine, jasmineEnv, junit, nunit, spec, specsList, _i, _len; + var defaults, error, jasmine, jasmineEnv, junit, nunit, spec, specsList, teamcity, _i, _len; jasmineEnv = loadJasmine(); defaults = { regExpSpec: new RegExp(".(js)$", "i"), @@ -147,7 +147,14 @@ nunit = new reporters.NUnitXmlReporter(options.reporterConfigOpts); jasmine.addReporter(nunit); } - if (!(options.junit || options.nunit)) { + if (options.teamcity) { + if (options.reporterConfigOpts == null) { + options.reporterConfigOpts = {}; + } + teamcity = new reporters.TeamCityReporter(options.reporterConfigOpts); + jasmine.addReporter(teamcity); + } + if (!(options.junit || options.nunit || options.teamcity)) { jasmine.addReporter(new jasmineEnv.TerminalReporter(options)); } if (options.growl) { diff --git a/lib/jasmine-node/runner.js b/lib/jasmine-node/runner.js index dddb2e6..b936ec4 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", "teamcity", "verbose", "version"], string: ["reporterConfig", "m", "match", "watchFolders"], alias: { match: "m", @@ -41,6 +41,7 @@ nunit: false, onComplete: function() {}, reporterConfig: '', + teamcity: false, specFolders: [], verbose: false, watchFolders: [] @@ -55,7 +56,7 @@ }; 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\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 --teamcity - use the teamcity reporter\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.exit(-1); }; diff --git a/package.json b/package.json index 65b0bb0..cea4e4c 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": "~2.0.2" }, "devDependencies": { "grunt-contrib-coffee": "~0.10.1", diff --git a/src/jasmine-loader.coffee b/src/jasmine-loader.coffee index 9593c24..574a108 100644 --- a/src/jasmine-loader.coffee +++ b/src/jasmine-loader.coffee @@ -127,8 +127,13 @@ executeSpecsInFolder = (options) -> nunit = new reporters.NUnitXmlReporter options.reporterConfigOpts jasmine.addReporter nunit + if options.teamcity + options.reporterConfigOpts ?= {} + teamcity = new reporters.TeamCityReporter options.reporterConfigOpts + jasmine.addReporter teamcity + # If not using junit and not using nunit, Terminal Reporter! - unless options.junit or options.nunit + unless options.junit or options.nunit or options.teamcity jasmine.addReporter new jasmineEnv.TerminalReporter options if options.growl diff --git a/src/runner.coffee b/src/runner.coffee index 8697e0b..bab9944 100644 --- a/src/runner.coffee +++ b/src/runner.coffee @@ -24,6 +24,7 @@ minimistOpts = "matchAll" "noColor" "noStackTrace" + "teamcity" "verbose" "version" ] @@ -54,6 +55,7 @@ minimistOpts = nunit : false onComplete : -> return reporterConfig : '' + teamcity : false specFolders : [] verbose : false watchFolders : [] @@ -83,6 +85,7 @@ Options: --noStackTrace - suppress the stack trace generated from a test failure --nunit - use the nunit reporter --reporterConfig - configuration json file to use with jasmine-reporters [nunit, junit] + --teamcity - use the teamcity reporter --verbose - print extra information per each test run --version - show the current version --watch PATH - when used with --autoTest, watches the given path(s) and runs all tests if a change is detected