From 103bc0f878a8870770c8a8afce0a3fbf8a516ea7 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 21 Mar 2013 16:12:14 -0700 Subject: [PATCH] feat(config): always ignore the config file itself It's been a very common issue, that people include the config file in the browser, which leads to unexpected errors. There is really no reason to load the config file in the browser. --- lib/config.js | 3 +++ test/e2e/basic/karma.conf.js | 4 ---- test/e2e/coffee/karma.conf.js | 2 -- test/e2e/coverage/karma.conf.js | 4 ---- test/e2e/coverageQunit/karma.conf.js | 4 ---- test/e2e/coverageRequirejs/karma.conf.js | 4 ---- test/e2e/junit/karma.conf.js | 4 ---- test/e2e/mocha/karma.conf.js | 4 ---- test/e2e/qunit/karma.conf.js | 4 ---- test/e2e/requirejs/karma.conf.js | 6 ------ test/e2e/timeout/karma.conf.ignore.js | 4 ---- 11 files changed, 3 insertions(+), 40 deletions(-) diff --git a/lib/config.js b/lib/config.js index d99797202..7ef69df98 100644 --- a/lib/config.js +++ b/lib/config.js @@ -239,6 +239,9 @@ var parseConfig = function(configFilePath, cliOptions) { // resolve basePath config.basePath = path.resolve(path.dirname(configFilePath), config.basePath); + // always ignore the config file itself + config.exclude.push(configFilePath); + return normalizeConfig(config); }; diff --git a/test/e2e/basic/karma.conf.js b/test/e2e/basic/karma.conf.js index b834ccd86..33bbb698d 100644 --- a/test/e2e/basic/karma.conf.js +++ b/test/e2e/basic/karma.conf.js @@ -4,10 +4,6 @@ files = [ '*.js' ]; -exclude = [ - 'karma.conf.js' -]; - autoWatch = true; browsers = ['Chrome']; diff --git a/test/e2e/coffee/karma.conf.js b/test/e2e/coffee/karma.conf.js index c111cb62d..3fa7b21ab 100644 --- a/test/e2e/coffee/karma.conf.js +++ b/test/e2e/coffee/karma.conf.js @@ -4,8 +4,6 @@ files = [ '*.coffee' ]; -exclude = []; - autoWatch = true; browsers = ['Chrome']; diff --git a/test/e2e/coverage/karma.conf.js b/test/e2e/coverage/karma.conf.js index 2561437a3..68acaa42f 100644 --- a/test/e2e/coverage/karma.conf.js +++ b/test/e2e/coverage/karma.conf.js @@ -5,10 +5,6 @@ files = [ 'test/*.js' ]; -exclude = [ - 'karma.conf.js' -]; - autoWatch = true; browsers = ['Chrome'] diff --git a/test/e2e/coverageQunit/karma.conf.js b/test/e2e/coverageQunit/karma.conf.js index 8e02c030d..481d6556b 100644 --- a/test/e2e/coverageQunit/karma.conf.js +++ b/test/e2e/coverageQunit/karma.conf.js @@ -5,10 +5,6 @@ files = [ 'test/*.js' ]; -exclude = [ - 'karma.conf.js' -]; - autoWatch = true; browsers = ['Chrome']; diff --git a/test/e2e/coverageRequirejs/karma.conf.js b/test/e2e/coverageRequirejs/karma.conf.js index 8f6a8728a..28638139a 100644 --- a/test/e2e/coverageRequirejs/karma.conf.js +++ b/test/e2e/coverageRequirejs/karma.conf.js @@ -5,10 +5,6 @@ files = [ {pattern: '*.js', included: false}, ]; -exclude = [ - 'karma.conf.js' -]; - autoWatch = true; browsers = ['Chrome']; singleRun = false; diff --git a/test/e2e/junit/karma.conf.js b/test/e2e/junit/karma.conf.js index 1b1fab689..0b9e9062f 100644 --- a/test/e2e/junit/karma.conf.js +++ b/test/e2e/junit/karma.conf.js @@ -4,10 +4,6 @@ files = [ '*.js' ]; -exclude = [ - 'karma.conf.js' -]; - autoWatch = true; browsers = ['Chrome'] diff --git a/test/e2e/mocha/karma.conf.js b/test/e2e/mocha/karma.conf.js index e28e3fbde..101d6246c 100644 --- a/test/e2e/mocha/karma.conf.js +++ b/test/e2e/mocha/karma.conf.js @@ -4,10 +4,6 @@ files = [ '*.js' ]; -exclude = [ - 'karma.conf.js' -]; - autoWatch = true; browsers = ['Chrome']; singleRun = false; diff --git a/test/e2e/qunit/karma.conf.js b/test/e2e/qunit/karma.conf.js index 5f0261447..ebfb2c8e9 100644 --- a/test/e2e/qunit/karma.conf.js +++ b/test/e2e/qunit/karma.conf.js @@ -4,10 +4,6 @@ files = [ '*.js' ]; -exclude = [ - 'karma.conf.js' -]; - autoWatch = true; browsers = ['Chrome']; diff --git a/test/e2e/requirejs/karma.conf.js b/test/e2e/requirejs/karma.conf.js index d48e98d79..ea6e62020 100644 --- a/test/e2e/requirejs/karma.conf.js +++ b/test/e2e/requirejs/karma.conf.js @@ -16,12 +16,6 @@ files = [ ]; -// list of files to exclude -exclude = [ - 'karma.conf.js' -]; - - // test results reporter to use // possible values: dots || progress reporter = 'dots'; diff --git a/test/e2e/timeout/karma.conf.ignore.js b/test/e2e/timeout/karma.conf.ignore.js index 25841a03b..2ad704da0 100644 --- a/test/e2e/timeout/karma.conf.ignore.js +++ b/test/e2e/timeout/karma.conf.ignore.js @@ -13,10 +13,6 @@ files = [ ]; -// list of files to exclude -exclude = []; - - // test results reporter to use // possible values: 'dots', 'progress', 'junit' reporters = ['progress'];