Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.0.5 #6

Merged
merged 3 commits into from May 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,20 @@
### 0.0.1 (April 15, 2013)

* Initial release

### 0.0.2 (April 16, 2013)

* Bug fixes

### 0.0.3 (April 16, 2013)

* Bug fixes

### 0.0.4 (April 26, 2013)

* Modifications to the params sent to coveralls.io (pull request #3)

### 0.0.5 (May 3, 2013)

* Fixed regressions introduced in 0.0.4 where the coveralls REST API requires the repo_token for all request (resolved #5)
* Fixed the on disk locating of mocha. Caused failures when mocha was a dependency of a project including this library. (resolved #4)
28 changes: 16 additions & 12 deletions lib/coveralls.js
Expand Up @@ -26,20 +26,24 @@ function coveralls() {
return {
convertLcovToCoveralls: function (input, options, callback) {

var postJson = {
source_files : []
};

var travisJobId = process.env.TRAVIS_JOB_ID || options.serviceJobId;
if (travisJobId && options.serviceName) {
postJson.service_job_id = travisJobId;
postJson.service_name = options.serviceName;
if (!options.repoToken) {
throw new Error('Can\'t send data to coveralls.io, \'repoToken\' and optionaly \'serviceJobId\' and \'serviceName\' should be provided');
}
else if (options.repoToken) {
postJson.repo_token = options.repoToken;

var jobId = options.serviceJobId,
serviceName = options.serviceName,
postJson = { source_files : [] };

// We use the API to submit to coveralls so the repo token is always required
postJson.repo_token = options.repoToken;

if (serviceName && /^travis-(ci|pro)$/.match(serviceName)) {
jobId = process.env.TRAVIS_JOB_ID || jobId;
}
else {
throw new Error('Can\'t send data to coveralls.io, repo_token (' + options.repoToken + ') or service_job_id (' + travisJobId + ') + service_name (' + options.serviceName + ') should be provided');

if (jobId && options.serviceName) {
postJson.service_job_id = jobId;
postJson.service_name = options.serviceName;
}

var detailsToCoverage = function (length, details) {
Expand Down
10 changes: 5 additions & 5 deletions lib/mocha.js
Expand Up @@ -47,10 +47,10 @@ exports = module.exports = mocha;
*/

function mocha(options, callback) {
var args = [];
var spawnOptions = {
cmd: __dirname + '/../node_modules/.bin/mocha'
};

var args = [],
mochaBasePath = path.dirname(require.resolve('mocha')),
spawnOptions = { cmd: path.normalize(mochaBasePath + '/bin/mocha') };

if (process.platform === 'win32') {
spawnOptions.cmd += '.cmd';
Expand All @@ -75,7 +75,7 @@ function mocha(options, callback) {
if (!Array.isArray(options.require)) {
options.require = [];
}
var instrumentModule = __dirname + '/instrument';
var instrumentModule = path.normalize(__dirname + '/instrument');
options.require.push(path.relative(process.cwd(), instrumentModule));
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "grunt-mocha-cov",
"description": "Run Mocha server-side tests in Grunt with code coverage support and optional integration to coveralls.io.",
"version": "0.0.4",
"version": "0.0.5",
"author": "Mike Moulton <mike@meltmedia.com> (http://meltmedia.com)",
"contributors": [
"Gregg Caines <gregg@caines.ca> (https://github.com/cainus/node-coveralls)",
Expand Down