Skip to content

Commit

Permalink
test: refactor config, add safari
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Sep 6, 2013
1 parent c440c8e commit 37e4ff9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 93 deletions.
72 changes: 3 additions & 69 deletions conf/karma.conf.js
Original file line number Diff line number Diff line change
@@ -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: '../../',

Expand Down Expand Up @@ -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'
]
});
}));
};
23 changes: 0 additions & 23 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,17 @@ 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: {
configFile: 'conf/karma.conf.js',
keepalive: true
},
buildbot: {
browsers: browsers,
reporters: ['crbot'],
logLevel: 'OFF'
},
polymer: {
browsers: browsers
}
},
concat_sourcemap: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tools

0 comments on commit 37e4ff9

Please sign in to comment.