Permalink
Browse files

Update karma config and add TravisCI configuration for it

  • Loading branch information...
1 parent 7567186 commit b558371b10141c79daa9dfde5fa9183485ead5e3 @meltingice committed Jun 22, 2013
Showing with 22 additions and 22 deletions.
  1. +6 −1 .travis.yml
  2. +3 −17 README.md
  3. +10 −2 {test → }/karma.conf.js
  4. +3 −2 package.json
View
@@ -1,3 +1,8 @@
language: node_js
+env: TRAVISCI=true
node_js:
- - 0.8
+ - "0.10"
+ - "0.8"
+before_script:
+ - export DISPLAY=:99.0
+ - sh -e /etc/init.d/xvfb start
View
@@ -99,27 +99,13 @@ Tests for CamanJS run both in NodeJS and the browser.
### NodeJS
-The NodeJS tests use mocha as the test runner. The simplest way to run the test suite is:
-
-```
-npm test
-```
+The NodeJS tests use mocha as the test runner. The simplest way to run the test suite is by running `npm test`.
### Browser
-The browser tests are run by Karma. It will start up Chrome, Firefox, and Safari in the background. If you're running Windows, you will want to remove Safari by editing `test/karma.conf.js`. You can minimize each of these browsers if desired. It will automatically run tests after CamanJS is recompiled by the Cakefile as well.
+The browser tests are run by Karma. It will start up Chrome, Firefox, and Safari (if running OSX) in the background. You can minimize each of these browsers if desired. It will automatically run tests after CamanJS is recompiled by the Cakefile as well.
-**Because it prefers to be installed globally, Karma is a soft dependency.**
-
-**Install**
-```
-npm install -g karma
-```
-
-**Run**
-```
-karma start test/karma.conf.js
-```
+You can run Karma by running `karma start`, or you can do a single run with the NodeJS tests by running `npm test`.
## Project Contributors
@@ -7,7 +7,7 @@
// base path, that will be used to resolve files and exclude
-basePath = '..';
+basePath = '.';
frameworks = ['jasmine'];
@@ -60,7 +60,15 @@ autoWatch = true;
// - PhantomJS
// - IE (only Windows)
// CLI --browsers Chrome,Firefox,Safari
-browsers = ['Chrome', 'Firefox', 'Safari'];
+browsers = ['Firefox'];
+
+if (!process.env.TRAVISCI) {
+ browsers.push('Chrome')
+
+ if (require('os').platform() === 'darwin') {
+ browsers.push('Safari')
+ }
+}
// If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
View
@@ -53,10 +53,11 @@
"chai": "*",
"servedir": "*",
"cli": "*",
- "cli-table": "*"
+ "cli-table": "*",
+ "karma": "*"
},
"scripts": {
- "test": "./node_modules/mocha/bin/mocha --compilers coffee:coffee-script --reporter spec --globals Caman ./test/unit/*.coffee",
+ "test": "./node_modules/mocha/bin/mocha --compilers coffee:coffee-script --reporter spec --globals Caman ./test/unit/*.coffee && ./node_modules/.bin/karma start --single-run",
"examples": "./node_modules/servedir/bin/servedir",
"docs": "codo",
"docs-server": "codo --server"

0 comments on commit b558371

Please sign in to comment.