Skip to content

Commit

Permalink
test: use reporter specified in config for e2e tests
Browse files Browse the repository at this point in the history
E2E test framework was overriding the reporters on the commandline.
This meant that tests e2e tests for reporter were not even using the
reporters they were supposed testing.  The test now use the specified
reporters, even if they don't verify their outputs.
  • Loading branch information
bitwiseman authored and vojtajina committed Feb 3, 2013
1 parent 9cdaf77 commit 87f0ac0
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var createReporters = function(names, config, emitter) {
var multiReporter = new MultiReporter();

names.forEach(function(name) {
log.debug('Using reporter "%s".', name);

if (name === 'junit') {
return multiReporter.reporters.push(new exports.JUnit(errorFormatter,
config.junitReporter.outputFile, config.junitReporter.suite, emitter));
Expand Down
2 changes: 1 addition & 1 deletion tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function(grunt) {
var tests = grunt.file.expand(this.data);
var processToKill;
var args = [
'start', null, '--single-run', '--no-auto-watch', '--reporters=dots', '--browsers=' + BROWSERS
'start', null, '--single-run', '--no-auto-watch', '--browsers=' + BROWSERS
];

var next = function(err, result, code) {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/angular-scenario/testacular.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ autoWatch = true;
proxies = {
'/': 'http://localhost:8000/test/e2e/angular-scenario/'
};

reporters = ['dots'];
2 changes: 2 additions & 0 deletions test/e2e/basic/testacular.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ exclude = [
autoWatch = true;

browsers = ['Chrome']

reporters = ['dots'];
2 changes: 2 additions & 0 deletions test/e2e/coffee/testacular.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ browsers = ['Chrome'];
preprocessors = {
'**/*.coffee': 'coffee'
};

reporters = ['dots'];
4 changes: 4 additions & 0 deletions test/e2e/junit/plus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Some code under test
function plus(a, b) {
return a + b;
}
11 changes: 11 additions & 0 deletions test/e2e/junit/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('plus', function() {
it('should pass', function() {
expect(true).toBe(true);
});

it('should work', function() {
console.log("First parameter: 1");
console.log("Second parameter: 2");
expect(plus(1, 2)).toBe(3);
});
});
22 changes: 22 additions & 0 deletions test/e2e/junit/testacular.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
files = [
JASMINE,
JASMINE_ADAPTER,
'*.js'
];

exclude = [
'testacular.conf.js'
];

autoWatch = true;

browsers = ['Chrome']

reporters = ['dots', 'junit'];

logLevel = LOG_DEBUG;

junitReporter = {
outputFile: 'test-results.xml'
};

2 changes: 2 additions & 0 deletions test/e2e/mocha/testacular.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ exclude = [
autoWatch = true;
browsers = ['Chrome'];
singleRun = false;

reporters = ['dots'];
2 changes: 2 additions & 0 deletions test/e2e/qunit/testacular.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ exclude = [
autoWatch = true;

browsers = ['Chrome']

reporters = ['dots'];
2 changes: 1 addition & 1 deletion test/e2e/requirejs/testacular.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exclude = [];

// test results reporter to use
// possible values: dots || progress
reporter = 'progress';
reporter = 'dots';


// web server port
Expand Down
1 change: 1 addition & 0 deletions test/e2e/syntax-error/testacular.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ autoWatch = true;
autoWatchInterval = 1;
logLevel = LOG_INFO;
logColors = true;
reporters = ['dots'];

0 comments on commit 87f0ac0

Please sign in to comment.