test(coverage): add coverage and coveralls.io integration · mgonto/restangular@fdd5de6

5 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -13,6 +13,7 @@ results

1313

lib

1414

node_modules

1515

components

16+

coverage

1617

bower_components

1718

npm-debug.log

1819

.idea

Original file line numberDiff line numberDiff line change

@@ -85,6 +85,23 @@ module.exports = function(grunt) {

8585

autoWatch: true

8686

}

8787

},

88+

coveralls: {

89+

// Options relevant to all targets

90+

options: {

91+

// When true, grunt-coveralls will only print a warning rather than

92+

// an error, to prevent CI builds from failing unnecessarily (e.g. if

93+

// coveralls.io is down). Optional, defaults to false.

94+

force: false

95+

},

96+
97+

restangular: {

98+

// LCOV coverage file (can be string, glob or array)

99+

src: 'coverage/**/lcov.info',

100+

options: {

101+

// Any options for just this target

102+

}

103+

},

104+

},

88105

changelog: {

89106

options: {

90107

dest: 'CHANGELOG.md'

@@ -111,6 +128,8 @@ module.exports = function(grunt) {

111128
112129

grunt.loadNpmTasks('grunt-zip');

113130
131+

grunt.loadNpmTasks('grunt-coveralls');

132+
114133
115134

// Default task.

116135

grunt.registerTask('default', ['build']);

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,7 @@

11

#Restangular

22
33

[![Build Status](https://travis-ci.org/mgonto/restangular.svg?branch=master)](https://travis-ci.org/mgonto/restangular)

4+

[![Coverage Status](https://coveralls.io/repos/github/mgonto/restangular/badge.svg?branch=master)](https://coveralls.io/github/mgonto/restangular?branch=master)

45

[![PayPayl donate button](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=martin%40gon%2eto&lc=US&item_name=Martin%20Gontovnikas&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted "Donate once-off to this project using Paypal")

56

[![Donate on Gittip](http://img.shields.io/gittip/mgonto.svg)](https://www.gittip.com/mgonto/)

67

<a href="https://twitter.com/intent/tweet?hashtags=&original_referer=http%3A%2F%2Fgithub.com%2F&text=Check+out+Restangular%2C+a+service+for+%23AngularJS+that+makes+it+easy+to+use+Rest+APIs&tw_p=tweetbutton&url=https%3A%2F%2Fgithub.com%2Fmgonto%2Frestangular" target="_blank">

Original file line numberDiff line numberDiff line change

@@ -29,7 +29,7 @@ module.exports = function (config) {

2929
3030

// test results reporter to use

3131

// possible values: 'dots', 'progress', 'junit'

32-

reporters: ['mocha'],

32+

reporters: ['mocha', 'coverage'],

3333
3434
3535

// web server port

@@ -70,7 +70,20 @@ module.exports = function (config) {

7070
7171

// Continuous Integration mode

7272

// if true, it capture browsers, run tests and exit

73-

singleRun: false

73+

singleRun: false,

74+
75+

preprocessors: {

76+

// source files, that you wanna generate coverage for

77+

// do not include tests or libraries

78+

// (these files will be instrumented by Istanbul)

79+

'src/**/*.js': ['coverage']

80+

},

81+
82+

// optionally, configure the reporter

83+

coverageReporter: {

84+

type: 'lcov',

85+

dir : 'coverage/'

86+

}

7487
7588

});

7689

};

Original file line numberDiff line numberDiff line change

@@ -37,17 +37,19 @@

3737

"devDependencies": {

3838

"angular-mocks": "^1.4.8",

3939

"grunt": "^0.4.5",

40+

"grunt-bower": "*",

41+

"grunt-bower-task": "*",

4042

"grunt-cli": ">= 0.1.7",

4143

"grunt-contrib-concat": "*",

4244

"grunt-contrib-jshint": "*",

4345

"grunt-contrib-uglify": "*",

44-

"grunt-bower": "*",

45-

"grunt-bower-task": "*",

46-

"grunt-karma": "latest",

4746

"grunt-conventional-changelog": "0.0.12",

47+

"grunt-coveralls": "^1.0.1",

48+

"grunt-karma": "latest",

4849

"grunt-zip": "*",

4950

"karma": "^0.13.19",

5051

"karma-chrome-launcher": "~v2.0.0",

52+

"karma-coverage": "^1.1.1",

5153

"karma-firefox-launcher": "~v1.0.0",

5254

"karma-jasmine": "~0.1.5",

5355

"karma-mocha-reporter": "0.2.8",