Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 7c286b0

Browse files
committed
adding support for coveralls integration for mean.js to report live project code coverage information
1 parent 7252032 commit 7c286b0

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/meanjs/mean?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44
[![Build Status](https://travis-ci.org/meanjs/mean.svg?branch=master)](https://travis-ci.org/meanjs/mean)
55
[![Dependencies Status](https://david-dm.org/meanjs/mean.svg)](https://david-dm.org/meanjs/mean)
6+
[![Coverage Status](https://coveralls.io/repos/meanjs/mean/badge.svg?branch=master&service=github)](https://coveralls.io/github/meanjs/mean?branch=master)
67

78
MEAN.JS is a full-stack JavaScript open-source solution, which provides a solid starting point for [MongoDB](http://www.mongodb.org/), [Node.js](http://www.nodejs.org/), [Express](http://expressjs.com/), and [AngularJS](http://angularjs.org/) based applications. The idea is to solve the common issues with connecting those frameworks, build a robust framework to support daily development needs, and help developers use better practices while working with popular JavaScript components.
89

gruntfile.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ module.exports = function (grunt) {
184184
coverage: true,
185185
require: 'test.js',
186186
coverageFolder: 'coverage',
187+
reportFormats: ['cobertura','lcovonly'],
187188
check: {
188189
lines: 40,
189190
statements: 40
190-
}
191+
}
191192
}
192193
}
193194
},
@@ -219,6 +220,15 @@ module.exports = function (grunt) {
219220
}
220221
});
221222

223+
grunt.event.on('coverage', function(lcovFileContents, done) {
224+
require('coveralls').handleInput(lcovFileContents, function(err) {
225+
if (err) {
226+
return done(err);
227+
}
228+
done();
229+
});
230+
});
231+
222232
// Load NPM tasks
223233
require('load-grunt-tasks')(grunt);
224234

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"load-grunt-tasks": "^3.2.0",
106106
"run-sequence": "^1.1.1",
107107
"should": "^7.0.1",
108-
"supertest": "^1.0.1"
108+
"supertest": "^1.0.1",
109+
"coveralls": "^2.11.4"
109110
}
110111
}

test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
/**
44
* Module dependencies.
55
*/
6-
var app, db, config;
6+
var app;
77

88
var path = require('path');
99
var app = require(path.resolve('./config/lib/app'));
1010

11-
app.init(function (app, db, config) {
12-
console.log('Initialized test automation');
11+
app.init(function () {
12+
console.log('Initialized test automation');
1313
});

0 commit comments

Comments
 (0)