Skip to content

Commit

Permalink
updated grunt and karma to run on travis using phantomJS, and chrome …
Browse files Browse the repository at this point in the history
…locally
  • Loading branch information
yoavaa committed Jun 17, 2014
1 parent d56d228 commit 5fe6521
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ before_script:

after_success:
- cat ./coverage/*/lcov.info | ./node_modules/coveralls/bin/coveralls.js

env:
- TREE_CI_ENV=travis
24 changes: 21 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ module.exports = function(grunt) {
singleRun: true,
preprocessors: {'*.js': 'coverage'},
reporters: ['progress', 'coverage'],
coverageReporter: {type: 'lcov'}
coverageReporter: {type: 'lcov'},
browsers: ['Chrome']
},
ci_travis: {
singleRun: true,
preprocessors: {'*.js': 'coverage'},
reporters: ['progress', 'coverage'],
coverageReporter: {type: 'lcov'},
browsers: ['PhantomJS']
},
dev: {
background: true
background: true,
browsers: ['Chrome']
}
},
connect: {
Expand Down Expand Up @@ -46,7 +55,16 @@ module.exports = function(grunt) {
});

//run tests only once (continuous integration mode)
grunt.registerTask('test', ['karma:ci']);
// grunt.registerTask('test', ['karma:ci']);
grunt.registerTask('test', function() {
console.log(process.env.TREE_CI_ENV);
if (process.env.TREE_CI_ENV == 'travis') {
grunt.task.run(['karma:ci_travis']);
}
else {
grunt.task.run(['karma:ci']);
}
});

//to debug tests during 'grunt serve', open: http://localhost:8880/debug.html
grunt.registerTask('serve', ['karma:dev', 'connect', 'watch']);
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ module.exports = function(config) {
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome']
browsers: ['PhantomJS']
});
};

0 comments on commit 5fe6521

Please sign in to comment.