Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
test: refactor config file, add safari
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Sep 6, 2013
1 parent 6c0baa9 commit 16f4758
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 90 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "benchmark/chartjs"]
path = benchmark/chartjs
url = https://github.com/nnnick/Chart.js.git
[submodule "tools"]
path = tools
url = https://github.com/Polymer/tools.git
69 changes: 3 additions & 66 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 All @@ -17,69 +18,5 @@ module.exports = function(karma) {
'tests/d8_array_fuzzer.js',
'tests/d8_planner_test.js'
],

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'
]
});
}));
};
24 changes: 0 additions & 24 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,17 @@
// limitations under the License.

module.exports = function(grunt) {

// 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'
},
'observe-js': {
browsers: browsers
}
}
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"grunt-karma": "*",
"karma-mocha": "*",
"karma-ie-launcher": "*",
"karma-safari-launcher": "*",
"karma-script-launcher": "*",
"karma-crbot-reporter": "*"
}
Expand Down
1 change: 1 addition & 0 deletions tools
Submodule tools added at 93f21a

0 comments on commit 16f4758

Please sign in to comment.