From 37e4ff9d15ea229e10c468bb9aeeeb820233024a Mon Sep 17 00:00:00 2001 From: Yvonne Yip Date: Fri, 6 Sep 2013 14:03:21 -0700 Subject: [PATCH] test: refactor config, add safari --- conf/karma.conf.js | 72 ++-------------------------------------------- gruntfile.js | 23 --------------- package.json | 1 + tools | 2 +- 4 files changed, 5 insertions(+), 93 deletions(-) diff --git a/conf/karma.conf.js b/conf/karma.conf.js index 1518f8cfce..573c264a7f 100644 --- a/conf/karma.conf.js +++ b/conf/karma.conf.js @@ -1,5 +1,6 @@ module.exports = function(karma) { - karma.set({ + var common = require('../tools/test/karma-common.conf.js'); + karma.set(common.mixin_common_opts(karma, { // base path, that will be used to resolve files and exclude basePath: '../../', @@ -40,73 +41,6 @@ module.exports = function(karma) { {pattern: 'polymer/test/**/*.html', included: false}, {pattern: 'polymer/test/**/*.css', included: false}, {pattern: 'polymer/test/**/*.js', included: false} - ], - - // list of files to exclude - exclude: [], - - frameworks: ['mocha'], - - // use dots reporter, as travis terminal does not support escaping sequences - // possible values: 'dots', 'progress', 'junit', 'teamcity' - // CLI --reporters progress - reporters: ['progress'], - - // web server port - // CLI --port 9876 - port: 9876, - - // cli runner port - // CLI --runner-port 9100 - runnerPort: 9100, - - // enable / disable colors in the output (reporters and logs) - // CLI --colors --no-colors - colors: true, - - // level of logging - // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG - // CLI --log-level debug - logLevel: karma.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - // CLI --auto-watch --no-auto-watch - autoWatch: true, - - // Start these browsers, currently available: - // - Chrome - // - ChromeCanary - // - Firefox - // - Opera - // - Safari (only Mac) - // - PhantomJS - // - IE (only Windows) - // CLI --browsers Chrome,Firefox,Safari - browsers: ['ChromeCanary'], - - // If browser does not capture in given timeout [ms], kill it - // CLI --capture-timeout 5000 - captureTimeout: 50000, - - // Auto run tests on start (when browsers are captured) and exit - // CLI --single-run --no-single-run - singleRun: true, - - // report which specs are slower than 500ms - // CLI --report-slower-than 500 - reportSlowerThan: 500, - - // compile coffee scripts - preprocessors: { - }, - - plugins: [ - 'karma-mocha', - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-ie-launcher', - 'karma-script-launcher', - 'karma-crbot-reporter' ] - }); + })); }; diff --git a/gruntfile.js b/gruntfile.js index a45603f76d..a67d95db03 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -26,27 +26,6 @@ module.exports = function(grunt) { Polymer = readManifest('build.json'); - // karma setup - var browsers; - (function() { - try { - var config = grunt.file.readJSON('local.json'); - if (config.browsers) { - browsers = config.browsers; - } - } catch (e) { - var os = require('os'); - browsers = ['Chrome', 'Firefox']; - //browsers = ['Chrome']; - if (os.type() === 'Darwin') { - browsers.push('ChromeCanary'); - } - if (os.type() === 'Windows_NT') { - browsers.push('IE'); - } - } - })(); - grunt.initConfig({ karma: { options: { @@ -54,12 +33,10 @@ module.exports = function(grunt) { keepalive: true }, buildbot: { - browsers: browsers, reporters: ['crbot'], logLevel: 'OFF' }, polymer: { - browsers: browsers } }, concat_sourcemap: { diff --git a/package.json b/package.json index 069eaa8496..89bd93801e 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "grunt-karma": "*", "karma-mocha": "*", "karma-ie-launcher": "*", + "karma-safari-launcher": "*", "karma-script-launcher": "*", "karma-crbot-reporter": "*", "grunt-audit": "~0.0.1", diff --git a/tools b/tools index cd2d1d71d4..93f21ac3de 160000 --- a/tools +++ b/tools @@ -1 +1 @@ -Subproject commit cd2d1d71d4cb4def9b8df1cc164047f80c5df844 +Subproject commit 93f21ac3de9e71e054a8d4875a5d77852f4f769d