Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Merge bc4393c into f3440a5
Browse files Browse the repository at this point in the history
  • Loading branch information
garbas committed Mar 24, 2014
2 parents f3440a5 + bc4393c commit 3705288
Show file tree
Hide file tree
Showing 5 changed files with 1,136 additions and 592 deletions.
22 changes: 15 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
language: node_js
node_js:
- 0.10
install:
- npm cache clean
- make bootstrap
script:
- make test-ci
after_success:
- ./node_modules/.bin/lcov-result-merger "coverage/**/lcov.info" | ./node_modules/.bin/coveralls
env:
global:
- secure: "AfyaqEddoOzyQS2lx22xRN9OR3FN4BYLXXfISUvyJjObTD4dG08ZHydWTQcvnKMhN0V92vybt2gKOxsTXMHuy5gclMHnDLeclabgHZA6h6kOJLRyyHyj8/fDDkOAuA0dCki4/TQGENoyFl9+ei1oWvQI0ZfVCNote7zj9987gp0="
- secure: "XBLWX9U+XotKYK5/w7DeKpaB4YtG1w3XaJH2upap+S1KgV+Nr/NHGcvHkD0ucuEkcySL6KofRXDmfyC4tNjW0jKuPs2dBxKPYL1xD0DDCYKlkX3diP9OmBAcwwqchw9U9eeN3R9UhiRCG/dnXwiuEoqy6DytbRB7UB4XSwyGQRA="
- SAUCE_CONNECT_READY_FILE=/tmp/sauce-connect-ready
matrix:
- BROWSERS="SL_Chrome,SL_Firefox"
- BROWSERS="SL_IE_8,SL_IE_9,SL_IE_10,SL_IE_11"
- BROWSERS="SL_Opera,SL_Safari"
- BROWSERS="SL_IPhone,SL_IPad,SL_Android"
install:
- make bootstrap
script:
- make test-once
- if [ "$TRAVIS_BRANCH" == "master" ]; then make test-ci; fi
after_success:
- if [ "$BROWSERS" == "SL_Chrome,SL_Firefox" ]; then ./node_modules/.bin/lcov-result-merger "coverage/**/lcov.info" | ./node_modules/.bin/coveralls; fi
matrix:
allow_failures:
- env: BROWSERS="SL_IPhone,SL_IPad,SL_Android"
167 changes: 4 additions & 163 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,169 +3,10 @@
module.exports = function(grunt) {
'use strict';

var requirejsOptions = require('./js/config'),
karmaConfig = require('./node_modules/karma/lib/config'),
karmaFiles = [];
var MockupGrunt = require('./js/grunt'),
requirejsOptions = require('./js/config'),
mockup = new MockupGrunt(requirejsOptions);

karmaFiles.push('bower_components/es5-shim/es5-shim.js');
karmaFiles.push('bower_components/es5-shim/es5-sham.js');
karmaFiles.push('bower_components/console-polyfill/index.js');
karmaFiles.push('node_modules/mocha/mocha.js');
karmaFiles.push('node_modules/karma-mocha/lib/adapter.js');
karmaFiles.push('node_modules/requirejs/require.js');
karmaFiles.push('node_modules/karma-requirejs/lib/adapter.js');

karmaFiles.push('js/config.js');
karmaFiles.push('tests/config.js');

for (var key in requirejsOptions.paths) {
karmaFiles.push({
pattern: requirejsOptions.paths[key] + '.js',
included: false
});
}

karmaFiles.push({pattern: 'tests/*-test.js', included: false});

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: { options: { jshintrc: '.jshintrc' }, all: ['Gruntfile.js', 'js/**/*.js', 'tests/**/*.js'] },
jscs: { options: { config: '.jscs.json' }, all: ['Gruntfile.js', 'js/**/*.js', 'tests/**/*.js'] },
karma: {
options: {
basePath: './',
frameworks: [],
files: karmaFiles,
preprocessors: { 'js/*.js': 'coverage', 'js/docs/*.js': 'coverage' },
reporters: ['dots', 'progress', 'coverage'],
coverageReporter: { type : 'lcov', dir : 'coverage/' },
port: 9876,
colors: true,
logLevel: karmaConfig.LOG_INFO,
autoWatch: true,
captureTimeout: 60000,
plugins: [
'karma-mocha',
'karma-coverage',
'karma-requirejs',
'karma-sauce-launcher',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-junit-reporter'
]
},
test: { browsers: ['PhantomJS'] },
testOnce: { singleRun: true, browsers: ['PhantomJS'] },
testDev: {
browsers: ['Chrome'],
preprocessors: {},
reporters: ['dots', 'progress'],
plugins: [ // without karma-coverage
'karma-mocha',
'karma-requirejs',
'karma-sauce-launcher',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-junit-reporter'
]
},
testCI: {
singleRun: true,
port: 8000,
browsers: [
'SL_Chrome',
'SL_Opera',
'SL_Firefox',
'SL_Safari',
'SL_IE_8',
'SL_IE_9',
'SL_IE_10',
'SL_IE_11'
//'SL_IPhone',
//'SL_IPad',
//'SL_Android'
],
reporters: ['junit', 'coverage', 'saucelabs'],
junitReporter: {
outputFile: 'test-results.xml'
},
sauceLabs: {
testName: 'MockupCore',
startConnect: true
},
customLaunchers: {
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome'
},
'SL_Firefox': {
base: 'SauceLabs',
browserName: 'firefox'
},
'SL_Opera': {
base: 'SauceLabs',
browserName: 'opera'
},
'SL_Safari': {
base: 'SauceLabs',
browserName: 'safari',
platform: 'Mac 10.8',
version: '6'
},
'SL_IE_8': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
},
'SL_IE_9': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2008',
version: '9'
},
'SL_IE_10': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 2012',
version: '10'
},
'SL_IE_11': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
},
'SL_IPhone': {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'OS X 10.8',
version: '6.1'
},
'SL_IPad': {
base: 'SauceLabs',
browserName: 'ipad',
platform: 'OS X 10.8',
version: '6.1'
},
'SL_Android': {
base: 'SauceLabs',
browserName: 'android',
platform: 'Linux',
version: '4.0'
}
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs-checker');
grunt.loadNpmTasks('grunt-karma');

grunt.registerTask('test', [ 'jshint', 'jscs', 'karma:test' ]);
grunt.registerTask('test_once', [ 'jshint', 'jscs', 'karma:testOnce' ]);
grunt.registerTask('test_dev', [ 'karma:testDev' ]);
grunt.registerTask('test_ci', [ 'jshint', 'jscs', 'karma:testOnce', 'karma:testCI' ]);
mockup.initGrunt(grunt);

};
25 changes: 10 additions & 15 deletions js/grunt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* globals module:true */
/* globals module:true,process:true */

(function() {
'use strict';
Expand All @@ -7,7 +7,14 @@
path = require('path'),
appDir = path.dirname(require.main.filename),
karmaConfig = require(appDir + '/../../../node_modules/karma/lib/config'),
MockupGrunt = function (requirejsOptions) { this.init(requirejsOptions); };
MockupGrunt = function (requirejsOptions) { this.init(requirejsOptions); },
BROWSERS = process.env.BROWSERS;

if (BROWSERS) {
BROWSERS = BROWSERS.split(',');
} else {
BROWSERS = [ 'SL_Chrome', 'SL_Firefox' ];
}

MockupGrunt.prototype = {

Expand Down Expand Up @@ -304,19 +311,7 @@
reporters: ['junit', 'coverage', 'saucelabs'],
junitReporter: { outputFile: 'test-results.xml' },
sauceLabs: { testName: 'Mockup', startConnect: true },
browsers: [
'SL_Chrome',
'SL_Firefox',
//'SL_Opera',
//'SL_Safari',
//'SL_IE_8',
//'SL_IE_9',
//'SL_IE_10',
//'SL_IE_11'
//'SL_IPhone',
//'SL_IPad',
//'SL_Android'
],
browsers: BROWSERS,
customLaunchers: {
'SL_Chrome': { base: 'SauceLabs', browserName: 'chrome', platform: 'Windows 8', version: '31' },
'SL_Firefox': { base: 'SauceLabs', browserName: 'firefox', platform: 'Windows 8', version: '26' },
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
"extend": "~1.2.1",
"grunt": "~0.4.3",
"grunt-cli": "~0.1.13",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-less": "~0.10.0",
"grunt-contrib-requirejs": "~0.4.3",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-jscs-checker": "~0.4.0",
"grunt-karma": "~0.8.0",
"grunt-sed": "~0.1.1",
"karma": "~0.12.0",
"karma-chrome-launcher": "~0.1.2",
"karma-coverage": "~0.2.0",
Expand Down

0 comments on commit 3705288

Please sign in to comment.