Permalink
Browse files

saucelabs for browser tests

  • Loading branch information...
1 parent 21ee9e4 commit 83f1e3f8a24015acef6423b32bb5c93e4a25bb9a Adam Draper committed Nov 20, 2016
Showing with 62 additions and 13 deletions.
  1. +18 −13 Gruntfile.js
  2. +41 −0 karma-ci.conf.js
  3. +3 −0 package.json
View
@@ -25,23 +25,26 @@ module.exports = function(grunt) {
all: ['tests/numeral/*.js']
},
karma: {
- ci: {
- options: {
- files: [
- 'numeral.js',
- 'tests/numeral/*.js'
- ],
- },
+ options: {
+ files: [
+ 'numeral.js',
+ 'tests/numeral/*.js'
+ ],
frameworks: [
'mocha',
'chai'
],
+ singleRun: true,
+ autoWatch: false
+ },
+ local: {
browsers: [
'Chrome',
'Firefox'
- ],
- singleRun: true,
- autoWatch: false
+ ]
+ },
+ ci: {
+ configFile: 'karma-ci.conf.js'
}
},
uglify: {
@@ -97,7 +100,7 @@ module.exports = function(grunt) {
grunt.registerTask('test', [
'jshint',
'mochaTest',
- 'karma'
+ 'karma:local'
]);
grunt.registerTask('test:npm', [
@@ -107,7 +110,7 @@ module.exports = function(grunt) {
grunt.registerTask('test:browser', [
'jshint',
- 'karma'
+ 'karma:local'
]);
// P
@@ -120,6 +123,8 @@ module.exports = function(grunt) {
// Travis CI task.
grunt.registerTask('travis', [
- 'test'
+ 'jshint',
+ 'mochaTest',
+ 'karma:ci'
]);
};
View
@@ -0,0 +1,41 @@
+module.exports = function(config) {
+ var customLaunchers = {
+ sl_chrome: {
+ base: 'SauceLabs',
+ browserName: 'chrome',
+ version: '50',
+ platform: 'OS X 10.11'
+ },
+ sl_firefox: {
+ base: 'SauceLabs',
+ browserName: 'firefox',
+ version: '45',
+ platform: 'OS X 10.11'
+ },
+ sl_ie: {
+ base: 'SauceLabs',
+ browserName: 'internet explorer',
+ version: '11.103',
+ platform: 'Windows 10'
+ }
+ };
+
+ process.env.SAUCE_USERNAME = 'numeraljs';
+ process.env.SAUCE_ACCESS_KEY = '5506968c-cfdc-4797-ba75-294620ad475f';
+
+ config.set({
+ reporters: [
+ 'mocha',
+ 'saucelabs'
+ ],
+ browserDisconnectTimeout : 10000,
+ browserNoActivityTimeout: 120000,
+ browserDisconnectTolerance : 1,
+ browsers: Object.keys(customLaunchers),
+ sauceLabs: {
+ testName: 'Web App Unit Tests'
+ },
+ customLaunchers: customLaunchers,
+ singleRun: true
+ });
+};
View
@@ -41,11 +41,14 @@
"grunt-contrib-uglify": "latest",
"grunt-karma": "^2.0.0",
"grunt-mocha-test": "^0.13.2",
+ "grunt-saucelabs": "*",
"karma": "^1.3.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
+ "karma-mocha-reporter": "^2.2.1",
+ "karma-sauce-launcher": "^1.1.0",
"mocha": "^3.1.2",
"uglify-js": "latest"
},

0 comments on commit 83f1e3f

Please sign in to comment.