Skip to content

Commit da9992a

Browse files
testing: [env] use karma for phantom
1 parent c162b58 commit da9992a

6 files changed

Lines changed: 47 additions & 36 deletions

File tree

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
language: node_js
22
node_js:
3-
- 0.8
4-
branches:
5-
only:
6-
- master
3+
- 0.10
4+
script: make test-travisci

Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
TESTS = test/*.js
3-
REPORTER = spec
3+
REPORTER = list
44

55
#
66
# Tests
77
#
88

9-
test: test-node
9+
test: test-node test-browser
1010

1111
test-node:
1212
@printf "\n ==> [Node.js]"
@@ -16,10 +16,9 @@ test-node:
1616
$(TESTS)
1717

1818
test-browser: build
19-
@printf "\n ==> [Phantom.Js]"
20-
@./node_modules/.bin/mocha-phantomjs \
21-
--R ${REPORTER} \
22-
./test/browser/index.html
19+
@printf "\n ==> [Karma]\n\n"
20+
@./node_modules/.bin/karma start \
21+
--single-run
2322

2423
test-cov: lib-cov
2524
@eql_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \
@@ -28,6 +27,14 @@ test-cov: lib-cov
2827
$(TESTS) \
2928
> coverage.html
3029

30+
test-travisci: test-node test-browser lib-cov
31+
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
32+
@type_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \
33+
--require ./test/bootstrap \
34+
--reporter mocha-lcov-reporter \
35+
$(TESTS) \
36+
| ./node_modules/coveralls/bin/coveralls.js
37+
3138
#
3239
# Components
3340
#
@@ -44,7 +51,7 @@ components: component.json
4451

4552
lib-cov:
4653
@rm -rf lib-cov
47-
@jscoverage lib lib-cov
54+
@./node_modules/.bin/jscoverage lib lib-cov
4855

4956
#
5057
# Clean up

karma.conf.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = function(config) {
2+
config.set({
3+
basePath: ''
4+
, frameworks: [ 'mocha' ]
5+
, files: [
6+
'build/build.js'
7+
, 'test/bootstrap/karma.js'
8+
, 'test/*.js'
9+
]
10+
, exclude: []
11+
, reporters: [ 'progress' ]
12+
, port: 9876
13+
, colors: true
14+
, logLevel: config.LOG_INFO
15+
, autoWatch: true
16+
, browsers: [ 'PhantomJS' ]
17+
, captureTimeout: 60000
18+
, singleRun: false
19+
});
20+
};

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
, "author": "Jake Luer <jake@alogicalparadox.com>"
66
, "license": "MIT"
77
, "keywords": [
8+
"deep equal"
9+
, "object equal"
10+
, "testing"
11+
, "chai util"
812
]
913
, "repository": {
1014
"type": "git"
@@ -22,8 +26,12 @@
2226
}
2327
, "devDependencies": {
2428
"component": "*"
29+
, "coveralls": "2.0.16"
30+
, "jscoverage": "0.3.7"
31+
, "karma": "0.10.x"
32+
, "karma-mocha": "*"
2533
, "mocha": "*"
26-
, "mocha-phantomjs": "*"
34+
, "mocha-lcov-reporter": "0.0.1"
2735
, "simple-assert": "*"
2836
}
2937
}

test/bootstrap/karma.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
global.assert = require('simple-assert');
2+
global.eql = require('deep-eql');

test/browser/index.html

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)