Skip to content

Commit 5ec87ba

Browse files
committed
Added ability to control browsers from command line when testing locally.
1 parent 6f40961 commit 5ec87ba

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ grunt --plugins=remove_button,restore_on_backspace
9191
When issuing a pull request, *please exclude changes in the "dist" folder to avoid merge conflicts*. Also, please ensure all the tests pass:
9292

9393
```sh
94-
$ npm test
94+
$ npm test # phantomjs
95+
$ BROWSERS=Firefox npm test
96+
$ BROWSERS=Firefox,Chrome npm test
97+
$ BROWSERS=Firefox,Chrome,Safari npm test
9598
```
9699

97100
## License

karma.conf.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ module.exports = function(config) {
5656
: ['mocha', 'coverage', 'coveralls']
5757
}
5858

59+
var browsers = targets[process.env.TARGET || 'phantomjs'];
60+
if (process.env.BROWSERS) {
61+
browsers = process.env.BROWSERS.split(',');
62+
}
63+
5964
config.set({
6065
frameworks: ['mocha', 'chai'],
6166
files: [
@@ -92,7 +97,7 @@ module.exports = function(config) {
9297
colors: true,
9398
captureTimeout: 0,
9499
logLevel: config.LOG_INFO,
95-
browsers: targets[process.env.TARGET || 'phantomjs'],
100+
browsers: browsers,
96101
browserDisconnectTolerance: 2,
97102
browserDisconnectTimeout: 10000,
98103
browserNoActivityTimeout: 120000,

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@
3131
"grunt-replace": "0.4.x",
3232
"karma": "^0.12.31",
3333
"karma-chai": "^0.1.0",
34+
"karma-chrome-launcher": "^0.1.7",
3435
"karma-coverage": "^0.2.7",
3536
"karma-coveralls": "^0.1.5",
37+
"karma-firefox-launcher": "^0.1.4",
3638
"karma-mocha": "^0.1.10",
3739
"karma-mocha-reporter": "^0.3.1",
3840
"karma-phantomjs-launcher": "^0.1.4",
41+
"karma-safari-launcher": "^0.1.1",
3942
"karma-sauce-launcher": "^0.2.10"
4043
},
4144
"scripts": {

0 commit comments

Comments
 (0)