From 0bc31f7027654e40eaeb6c135f0dd9522bac7d4b Mon Sep 17 00:00:00 2001 From: Jonny Reeves Date: Thu, 12 Feb 2015 07:25:31 +0000 Subject: [PATCH 1/2] Modify qunit_junit task to be a mutli-task. --- README.md | 9 +++++---- tasks/qunit-junit.js | 2 +- test/tasks/tester.js | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 63bbd98..45f5b05 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,11 @@ In your project's Gruntfile, add a section named `qunit_junit` to the data objec ```js grunt.initConfig({ - qunit_junit: { - options: { - // Task-specific options go here. + all: { + options: { + // Task-specific options go here. + } } }, }) @@ -124,7 +125,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style. ## Release History -* 0.3.0 added ability to provide custom url, module and test namers. +* 0.3.0 added ability to provide custom url, module and test namers, changed to be a multi-task * 0.2.0 updated `grunt-contrib-qunit` to 0.5.2 to report actual test durations. * 0.1.1 added time attribute to output with dummy value, to aid compatibility * 0.1.0 is available for general use. diff --git a/tasks/qunit-junit.js b/tasks/qunit-junit.js index 8154bad..29445e0 100644 --- a/tasks/qunit-junit.js +++ b/tasks/qunit-junit.js @@ -186,7 +186,7 @@ module.exports = function (grunt) { }); - grunt.registerTask('qunit_junit', + grunt.registerMultiTask('qunit_junit', 'Log JUnit style XML reports for QUnit tests', function () { var options = this.options({ dest: '_build/test-reports', diff --git a/test/tasks/tester.js b/test/tasks/tester.js index 0bd382a..89fe882 100644 --- a/test/tasks/tester.js +++ b/test/tasks/tester.js @@ -92,7 +92,7 @@ module.exports = function (grunt) { qunitConfig.options.urls = settings.urls; } grunt.log.ok("Performing setup for " + name); - grunt.config('qunit_junit.options', settings.options); + grunt.config('qunit_junit.all.options', settings.options); grunt.config.set('qunit.all', qunitConfig); }; @@ -220,7 +220,7 @@ module.exports = function (grunt) { grunt.config('harness.teardown_' + name, _.bind(teardownSuite, null, name, settings, errors[name])); - grunt.task.run('harness:setup_' + name, 'qunit_junit', 'qunit:all', + grunt.task.run('harness:setup_' + name, 'qunit_junit:all', 'qunit:all', 'harness:teardown_' + name); }); From 0cf9c8ffe4757ea4f6e53d859fdf9ed8c5577160 Mon Sep 17 00:00:00 2001 From: Jonny Reeves Date: Thu, 19 Feb 2015 21:13:27 +0000 Subject: [PATCH 2/2] Modfiy tester to ensure that the multi-task configuration is being applied. --- README.md | 2 +- test/tasks/tester.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 45f5b05..d560cce 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style. ## Release History -* 0.3.0 added ability to provide custom url, module and test namers, changed to be a multi-task +* 0.3.0 added ability to provide custom url, module and test namers * 0.2.0 updated `grunt-contrib-qunit` to 0.5.2 to report actual test durations. * 0.1.1 added time attribute to output with dummy value, to aid compatibility * 0.1.0 is available for general use. diff --git a/test/tasks/tester.js b/test/tasks/tester.js index 89fe882..ffebd7e 100644 --- a/test/tasks/tester.js +++ b/test/tasks/tester.js @@ -92,7 +92,7 @@ module.exports = function (grunt) { qunitConfig.options.urls = settings.urls; } grunt.log.ok("Performing setup for " + name); - grunt.config('qunit_junit.all.options', settings.options); + grunt.config('qunit_junit.' + name + '.options', settings.options); grunt.config.set('qunit.all', qunitConfig); }; @@ -220,7 +220,7 @@ module.exports = function (grunt) { grunt.config('harness.teardown_' + name, _.bind(teardownSuite, null, name, settings, errors[name])); - grunt.task.run('harness:setup_' + name, 'qunit_junit:all', 'qunit:all', + grunt.task.run('harness:setup_' + name, 'qunit_junit:' + name, 'qunit:all', 'harness:teardown_' + name); });