Skip to content

Update karma to run both firefox & chrome tests #894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,15 @@ module.exports = function (grunt) {
karma: {
unit: {
configFile: 'test/karma.conf.js',
singleRun: true
singleRun: true,
// default in karma.conf.js is Firefox, however, Chrome has much better
// error messages when writing tests. Call like this:
// grunt test
// grunt test --browsers=Chrome
// grunt test --browsers=Chrome,Firefox,Safari (be sure karma-<browser_name>-launcher is installed)
browsers: grunt.option('browsers') ?
grunt.option('browsers').split(',') :
['Firefox']
}
},

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"jasmine-spec-reporter": "1.1.2",
"jshint-stylish": "0.2.0",
"karma": "0.12.23",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "0.2.6",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "0.1.5",
Expand Down
3 changes: 1 addition & 2 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ module.exports = function(config) {
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Firefox'],
// Which plugins to enable
plugins: [
'karma-firefox-launcher',
'karma-chrome-launcher',
'karma-ng-html2js-preprocessor',
'karma-jasmine',
'karma-coverage'
Expand Down