Run tests on Sauce Labs

* Issue #57
This commit is contained in:
Arlo Breault 2014-11-22 19:36:52 -08:00
parent 6125f7cbbb
commit 8d56a1b248
4 changed files with 129 additions and 6 deletions

71
.jshintrc Normal file
View file

@ -0,0 +1,71 @@
{
"maxerr" : 50,
"bitwise" : false,
"camelcase" : false,
"curly" : false,
"eqeqeq" : false,
"forin" : false,
"freeze" : false,
"immed" : false,
"indent" : 4,
"latedef" : false,
"newcap" : false,
"noarg" : false,
"noempty" : false,
"nonbsp" : false,
"nonew" : false,
"plusplus" : false,
"quotmark" : false,
"undef" : false,
"unused" : false,
"strict" : false,
"maxparams" : false,
"maxdepth" : false,
"maxstatements" : false,
"maxcomplexity" : false,
"maxlen" : false,
"asi" : false,
"boss" : false,
"debug" : false,
"eqnull" : false,
"es5" : false,
"esnext" : false,
"moz" : false,
"evil" : false,
"expr" : false,
"funcscope" : false,
"globalstrict" : false,
"iterator" : false,
"lastsemic" : false,
"laxbreak" : false,
"laxcomma" : false,
"loopfunc" : false,
"multistr" : false,
"noyield" : false,
"notypeof" : false,
"proto" : false,
"scripturl" : false,
"shadow" : false,
"sub" : false,
"supernew" : false,
"validthis" : false,
"browser" : false,
"browserify" : false,
"couch" : false,
"devel" : false,
"dojo" : false,
"jasmine" : false,
"jquery" : false,
"mocha" : false,
"mootools" : false,
"node" : false,
"nonstandard" : false,
"prototypejs" : false,
"qunit" : false,
"rhino" : false,
"shelljs" : false,
"worker" : false,
"wsh" : false,
"yui" : false,
"globals" : {}
}

10
.travis.yml Normal file
View file

@ -0,0 +1,10 @@
language: node_js
node_js:
- '0.10'
install:
- npm install
script:
- npm test
env:
global:
- secure:

View file

@ -1,8 +1,9 @@
'use strict';
var child_process = require('child_process');
var util = require('util');
module.exports = function(grunt) {
'use strict';
var bower = grunt.file.readJSON('bower.json');
var components = [];
for (var i in bower.concat.app) {
@ -10,6 +11,7 @@ module.exports = function(grunt) {
}
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
components: {
src: components,
@ -77,11 +79,40 @@ module.exports = function(grunt) {
'malloc'
]
}
},
jshint: {
files: ['Gruntfile.js'], // add 'src/**/*.js', 'test/**/*.js'
options: { jshintrc: '.jshintrc' },
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
},
connect: {
server: {
options: {
base: '.',
port: 9999
}
}
},
'saucelabs-mocha': {
all: {
options: {
urls: ['http://127.0.0.1:9999/test/index.html'],
build: process.env.TRAVIS_JOB_ID,
browsers: [{ browserName: 'chrome' }],
testname: 'TextSecure-Browser Tests'
}
}
}
});
Object.keys(grunt.config.get('pkg').devDependencies).forEach(function(key) {
if (/^grunt(?!(-cli)?$)/.test(key)) { // ignore grunt and grunt-cli
grunt.loadNpmTasks(key);
}
});
grunt.loadNpmTasks('grunt-preen');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.registerMultiTask('compile', 'Compile the C libraries with emscripten.', function() {
var callback = this.async();
@ -117,6 +148,9 @@ module.exports = function(grunt) {
});
});
grunt.registerTask('dev', ['connect', 'watch']);
grunt.registerTask('test', ['jshint', 'connect', 'saucelabs-mocha']);
grunt.registerTask('default', ['preen', 'concat', 'sass']);
grunt.registerTask('build', ['compile', 'concat:curve25519']);
};

View file

@ -5,9 +5,17 @@
"devDependencies": {
"bower": "^1.3.12",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-sass": "^0.8.1",
"grunt-preen": "^1.0.0"
"grunt-contrib-watch": "^0.6.1",
"grunt-preen": "^1.0.0",
"grunt-saucelabs": "^8.3.3"
},
"scripts": {
"test": "grunt test",
"lint": "grunt jshint"
}
}