Skip to content

Commit

Permalink
Merge pull request #9 from schubergphilis/fix/coverage_es6_sourcemaps
Browse files Browse the repository at this point in the history
Do a remapping of the code coverage using sourcemaps to support ES6
  • Loading branch information
tommyminds committed Oct 5, 2015
2 parents 87c9f80 + 0cbf113 commit 8ed9ce2
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
sudo: false
node_js:
- "0.12"

env:
- PHANTOMJS2_VERSION=2.0.0
Expand Down
23 changes: 19 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = function(grunt) {
pkg: grunt.file.readJSON('package.json'),

clean: {
build: './dist/*'
build: './dist/*',
coverage: './coverage/*'
},

eslint: {
Expand All @@ -33,8 +34,19 @@ module.exports = function(grunt) {
}
},

remapIstanbul: {
build: {
src: 'coverage/lcov.json',
options: {
reports: {
lcovonly: 'coverage/lcov-remapped.info'
}
}
}
},

coveralls: {
src: 'coverage/lcov.info'
src: 'coverage/lcov-remapped.info'
},

babel: {
Expand All @@ -54,15 +66,18 @@ module.exports = function(grunt) {
}
});

grunt.loadNpmTasks('remap-istanbul');
grunt.file.expand('node_modules/grunt-*/tasks')
.forEach(grunt.loadTasks);

// Default task.
grunt.registerTask('build', [
'eslint',
'karma',
'clean',
'babel'
'babel',
'karma',
'remapIstanbul'
]);

grunt.registerTask('default', ['build']);
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Anglue is a framework that enables you to leverage the full potential of ES6/7 when writing Flux Angular 1.x applications. It's the glue that brings together all the different pieces and allows you to write applications in a consistent manner.

[![Build Status](https://travis-ci.org/schubergphilis/anglue.svg)](https://travis-ci.org/schubergphilis/anglue)
[![Coverage Status](https://coveralls.io/repos/schubergphilis/anglue/badge.svg?branch=&service=github)](https://coveralls.io/github/schubergphilis/anglue?branch=)
[![Coverage Status](https://coveralls.io/repos/schubergphilis/anglue/badge.svg?branch=master&service=github)](https://coveralls.io/github/schubergphilis/anglue?branch=)
[![Docs Coverage](https://doc.esdoc.org/github.com/schubergphilis/anglue/badge.svg)](https://doc.esdoc.org/github.com/schubergphilis/anglue/)
[![devDependency Status](https://david-dm.org/schubergphilis/anglue/dev-status.svg)](https://david-dm.org/schubergphilis/anglue#info=devDependencies)

Expand Down
2 changes: 1 addition & 1 deletion karma-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require.config({
deps: allTestFiles,

paths: {
'anglue': 'src',
'anglue': 'dist/amd',
'luxyflux': 'bower_components/luxyflux/dist/amd',
'angular': 'bower_components/angular/angular',
'angular-mocks': 'bower_components/angular-mocks/angular-mocks',
Expand Down
11 changes: 6 additions & 5 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ module.exports = function(config) {
{pattern: 'bower_components/angular-mocks/angular-mocks.js', included: false},
{pattern: 'bower_components/angular-ui-router/release/angular-ui-router.js', included: false},
{pattern: 'bower_components/luxyflux/dist/amd/**/*.js', included: false},
{pattern: 'src/**/*.js', included: false}
{pattern: 'dist/amd/**/*.js', included: false},
{pattern: 'src/**/*.spec.js', included: false}
],

// list of files to exclude
exclude: [],

preprocessors: {
'src/**/*.spec.js': ['babel'],
'src/**/!(*.spec).js': ['babel', 'coverage']
'dist/**/*.js': ['coverage', 'sourcemap'],
'src/**/*.spec.js': ['babel']
},

// test results reporter to use
Expand All @@ -42,10 +43,10 @@ module.exports = function(config) {

coverageReporter: {
reporters: [{
type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
type: 'json', // lcov or lcovonly are required for generating lcov.info files
dir: 'coverage/',
subdir: '.',
file: 'lcov.info'
file: 'lcov.json'
}, {
type: 'text-summary'
}]
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"karma-jasmine": "^0.3.6",
"karma-phantomjs2-launcher": "^0.3.2",
"karma-requirejs": "^0.2.2",
"karma-sourcemap-loader": "^0.3.5",
"remap-istanbul": "^0.3.0",
"requirejs": "^2.1.20"
},
"directories": {
Expand Down

0 comments on commit 8ed9ce2

Please sign in to comment.