From 91d66fbcc8765c709d0cd3a7c5cf5777d0b0a156 Mon Sep 17 00:00:00 2001 From: Steven Glanzer Date: Sun, 24 May 2015 09:36:00 -0400 Subject: [PATCH 1/2] Adding an autostart option --- README.md | 5 +++++ blueprints/ember-cli-blanket/files/tests/blanket-options.js | 3 ++- package.json | 2 +- vendor/blanket-require.js | 4 ---- vendor/start.js | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 213f8a0..371adc0 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,11 @@ MIT ## Release History +* 0.5.2 + +QUnit users: +blanket-options now includes an autostart option (default true) to control the value of QUnit.config.autostart after the code coverage instrumentation is complete + * 0.5.0 Thanks to monumental effort from @jschilli the project now supports reporters and headless test runs. Additionally, unit tests are now in place with continuous integration and the code base is much cleaner. Amazing work Jeff! diff --git a/blueprints/ember-cli-blanket/files/tests/blanket-options.js b/blueprints/ember-cli-blanket/files/tests/blanket-options.js index cc3e8cd..d03c0cd 100644 --- a/blueprints/ember-cli-blanket/files/tests/blanket-options.js +++ b/blueprints/ember-cli-blanket/files/tests/blanket-options.js @@ -8,7 +8,8 @@ var options = { enableCoverage: true, cliOptions: { reporters: ['json'] - } + }, + autostart: true }; if (typeof exports === 'undefined') { blanket.options(options); diff --git a/package.json b/package.json index ea34a42..2f05387 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-cli-blanket", - "version": "0.5.1", + "version": "0.5.2", "description": "Blanket code coverage for ember-cli", "main": "index.js", "directories": { diff --git a/vendor/blanket-require.js b/vendor/blanket-require.js index 3c11189..4c43310 100644 --- a/vendor/blanket-require.js +++ b/vendor/blanket-require.js @@ -42,10 +42,6 @@ var blanketLoader = function(moduleName) { // Defer the start of the test run until a call to QUnit.start() this // allows the modules to be loaded/instrumented prior to the test run if (typeof(QUnit) === 'object') { - var autostart = QUnit.config.autostart; - window._$blanket_qunit = { - autostart: autostart - }; QUnit.config.autostart = false; } diff --git a/vendor/start.js b/vendor/start.js index 6daf5d1..febc66a 100644 --- a/vendor/start.js +++ b/vendor/start.js @@ -22,7 +22,7 @@ function cliFinish() { blanket.onTestsDone = cliFinish; if (typeof(QUnit) === 'object') { - QUnit.config.autostart = window._$blanket_qunit.autostart; +QUnit.config.autostart = blanket.options('autostart'); } else if (typeof(mocha) === 'object') { From 33fd26801dbfc6e185659f2b93cf115ea7b68ec3 Mon Sep 17 00:00:00 2001 From: Steven Glanzer Date: Sun, 24 May 2015 12:03:47 -0400 Subject: [PATCH 2/2] Moving the autostart option inside cliOptions --- blueprints/ember-cli-blanket/files/tests/blanket-options.js | 6 +++--- vendor/start.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/blueprints/ember-cli-blanket/files/tests/blanket-options.js b/blueprints/ember-cli-blanket/files/tests/blanket-options.js index d03c0cd..3c4dbdd 100644 --- a/blueprints/ember-cli-blanket/files/tests/blanket-options.js +++ b/blueprints/ember-cli-blanket/files/tests/blanket-options.js @@ -7,9 +7,9 @@ var options = { loaderExclusions: [], enableCoverage: true, cliOptions: { - reporters: ['json'] - }, - autostart: true + reporters: ['json'], + autostart: true + } }; if (typeof exports === 'undefined') { blanket.options(options); diff --git a/vendor/start.js b/vendor/start.js index febc66a..0678b3d 100644 --- a/vendor/start.js +++ b/vendor/start.js @@ -22,7 +22,7 @@ function cliFinish() { blanket.onTestsDone = cliFinish; if (typeof(QUnit) === 'object') { -QUnit.config.autostart = blanket.options('autostart'); + QUnit.config.autostart = blanket.options('cliOptions').autostart !== false; } else if (typeof(mocha) === 'object') {