Commit 02fb2baf by Torkel Ödegaard

Added code coverage, and sending reports to coveralls

parent 23c9f973
node_modules node_modules
coverage/
.aws-config.json .aws-config.json
dist dist
......
...@@ -2,4 +2,6 @@ language: node_js ...@@ -2,4 +2,6 @@ language: node_js
node_js: node_js:
- "0.10" - "0.10"
before_script: before_script:
- npm install -g grunt-cli - npm install -g grunt-cli
\ No newline at end of file after_script:
- npm run coveralls
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
"karma": "~0.12.16", "karma": "~0.12.16",
"karma-chrome-launcher": "~0.1.4", "karma-chrome-launcher": "~0.1.4",
"karma-coffee-preprocessor": "~0.1.2", "karma-coffee-preprocessor": "~0.1.2",
"karma-coverage": "^0.2.5",
"karma-coveralls": "^0.1.4",
"karma-expect": "~1.1.0", "karma-expect": "~1.1.0",
"karma-firefox-launcher": "~0.1.3", "karma-firefox-launcher": "~0.1.3",
"karma-html2js-preprocessor": "~0.1.0", "karma-html2js-preprocessor": "~0.1.0",
...@@ -54,7 +56,8 @@ ...@@ -54,7 +56,8 @@
"npm": "1.2.x" "npm": "1.2.x"
}, },
"scripts": { "scripts": {
"test": "grunt test" "test": "grunt test",
"coveralls": "grunt karma:coveralls && rm -rf ./coverage"
}, },
"license": "Apache License", "license": "Apache License",
"dependencies": { "dependencies": {
......
...@@ -2,17 +2,17 @@ module.exports = function(config) { ...@@ -2,17 +2,17 @@ module.exports = function(config) {
'use strict'; 'use strict';
config.set({ config.set({
basePath: '../', basePath: '../../',
frameworks: ['mocha', 'requirejs', 'expect', 'sinon'], frameworks: ['mocha', 'requirejs', 'expect', 'sinon'],
// list of files / patterns to load in the browser // list of files / patterns to load in the browser
files: [ files: [
'test/test-main.js', 'src/test/test-main.js',
{pattern: 'app/**/*.js', included: false}, {pattern: 'src/app/**/*.js', included: false},
{pattern: 'vendor/**/*.js', included: false}, {pattern: 'src/vendor/**/*.js', included: false},
{pattern: 'test/**/*.js', included: false}, {pattern: 'src/test/**/*.js', included: false},
{pattern: '**/*.js', included: false} {pattern: 'src/**/*.js', included: false}
], ],
// list of files to exclude // list of files to exclude
...@@ -23,8 +23,9 @@ module.exports = function(config) { ...@@ -23,8 +23,9 @@ module.exports = function(config) {
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['Chrome'], browsers: ['PhantomJS'],
captureTimeout: 60000, captureTimeout: 60000,
singleRun: false, singleRun: true,
}); });
}; };
require.config({ require.config({
baseUrl: 'http://localhost:9876/base/app', baseUrl: 'http://localhost:9876/base/src/app',
paths: { paths: {
specs: '../test/specs', specs: '../test/specs',
......
...@@ -3,7 +3,6 @@ module.exports = function(config) { ...@@ -3,7 +3,6 @@ module.exports = function(config) {
dev: { dev: {
configFile: 'src/test/karma.conf.js', configFile: 'src/test/karma.conf.js',
singleRun: false, singleRun: false,
browsers: ['PhantomJS']
}, },
debug: { debug: {
configFile: 'src/test/karma.conf.js', configFile: 'src/test/karma.conf.js',
...@@ -12,8 +11,17 @@ module.exports = function(config) { ...@@ -12,8 +11,17 @@ module.exports = function(config) {
}, },
test: { test: {
configFile: 'src/test/karma.conf.js', configFile: 'src/test/karma.conf.js',
singleRun: true, },
browsers: ['PhantomJS'] coveralls: {
configFile: 'src/test/karma.conf.js',
reporters: ['dots','coverage','coveralls'],
preprocessors: {
'src/app/**/*.js': ['coverage']
},
coverageReporter: {
type: 'lcov',
dir: 'coverage/'
}
} }
}; };
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment