Added code coverage, and sending reports to coveralls

This commit is contained in:
Torkel Ödegaard 2014-08-07 14:58:57 +02:00
parent 23c9f973cc
commit 02fb2baf62
6 changed files with 29 additions and 14 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
node_modules
coverage/
.aws-config.json
dist

View File

@ -2,4 +2,6 @@ language: node_js
node_js:
- "0.10"
before_script:
- npm install -g grunt-cli
- npm install -g grunt-cli
after_script:
- npm run coveralls

View File

@ -36,6 +36,8 @@
"karma": "~0.12.16",
"karma-chrome-launcher": "~0.1.4",
"karma-coffee-preprocessor": "~0.1.2",
"karma-coverage": "^0.2.5",
"karma-coveralls": "^0.1.4",
"karma-expect": "~1.1.0",
"karma-firefox-launcher": "~0.1.3",
"karma-html2js-preprocessor": "~0.1.0",
@ -54,7 +56,8 @@
"npm": "1.2.x"
},
"scripts": {
"test": "grunt test"
"test": "grunt test",
"coveralls": "grunt karma:coveralls && rm -rf ./coverage"
},
"license": "Apache License",
"dependencies": {

View File

@ -2,17 +2,17 @@ module.exports = function(config) {
'use strict';
config.set({
basePath: '../',
basePath: '../../',
frameworks: ['mocha', 'requirejs', 'expect', 'sinon'],
// list of files / patterns to load in the browser
files: [
'test/test-main.js',
{pattern: 'app/**/*.js', included: false},
{pattern: 'vendor/**/*.js', included: false},
{pattern: 'test/**/*.js', included: false},
{pattern: '**/*.js', included: false}
'src/test/test-main.js',
{pattern: 'src/app/**/*.js', included: false},
{pattern: 'src/vendor/**/*.js', included: false},
{pattern: 'src/test/**/*.js', included: false},
{pattern: 'src/**/*.js', included: false}
],
// list of files to exclude
@ -23,8 +23,9 @@ module.exports = function(config) {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
browsers: ['PhantomJS'],
captureTimeout: 60000,
singleRun: false,
singleRun: true,
});
};

View File

@ -1,5 +1,5 @@
require.config({
baseUrl: 'http://localhost:9876/base/app',
baseUrl: 'http://localhost:9876/base/src/app',
paths: {
specs: '../test/specs',

View File

@ -3,7 +3,6 @@ module.exports = function(config) {
dev: {
configFile: 'src/test/karma.conf.js',
singleRun: false,
browsers: ['PhantomJS']
},
debug: {
configFile: 'src/test/karma.conf.js',
@ -12,8 +11,17 @@ module.exports = function(config) {
},
test: {
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/'
}
}
};
};