Comparing version 2.11.12 to 2.11.13
@@ -64,3 +64,6 @@ var TRAVIS_JOB_ID = process.env.TRAVIS_JOB_ID || 'unknown'; | ||
parsed.forEach(function(file){ | ||
postJson.source_files.push(convertLcovFileObject(file, filepath)); | ||
var currentFilePath = path.resolve(filepath, file.file); | ||
if (fs.existsSync(currentFilePath)) { | ||
postJson.source_files.push(convertLcovFileObject(file, filepath)); | ||
} | ||
}); | ||
@@ -67,0 +70,0 @@ return cb(null, postJson); |
@@ -12,2 +12,3 @@ var fs = require('fs'); | ||
var git_branch = process.env.COVERALLS_GIT_BRANCH; | ||
var git_committer_name, git_committer_email, git_message; | ||
@@ -61,2 +62,5 @@ var match = (process.env.CI_PULL_REQUEST || "").match(/(\d+)$/); | ||
git_branch = process.env.CI_BRANCH; | ||
git_committer_name = process.env.CI_COMMITTER_NAME; | ||
git_committer_email = process.env.CI_COMMITTER_EMAIL; | ||
git_message = process.env.CI_COMMIT_MESSAGE; | ||
} | ||
@@ -85,2 +89,7 @@ | ||
} | ||
if(process.env.SURF_SHA1){ | ||
options.service_name = 'surf'; | ||
git_commit = process.env.SURF_SHA1; | ||
git_branch = process.env.SURF_REF; | ||
} | ||
options.run_at = process.env.COVERALLS_RUN_AT || JSON.stringify(new Date()).slice(1, -1); | ||
@@ -129,3 +138,6 @@ if (process.env.COVERALLS_SERVICE_NAME){ | ||
head: { | ||
id: git_commit | ||
id: git_commit, | ||
committer_name: git_committer_name, | ||
committer_email: git_committer_email, | ||
message: git_message | ||
}, | ||
@@ -132,0 +144,0 @@ branch: git_branch |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "2.11.12", | ||
"version": "2.11.13", | ||
"bugs": { | ||
@@ -14,3 +14,3 @@ "url": "https://github.com/nickmerwin/node-coveralls/issues" | ||
"scripts": { | ||
"test": "make test" | ||
"test": "snyk test && make test" | ||
}, | ||
@@ -31,18 +31,20 @@ "bin": { | ||
"mattjmorrison <mattjmorrison@mattjmorrison.com> (http://mattjmorrison.com)", | ||
"Arpad Borsos <arpad.borsos@googlemail.com> (http://swatinem.de/)" | ||
"Arpad Borsos <arpad.borsos@googlemail.com> (http://swatinem.de/)", | ||
"Adam Moss (https://github.com/adam-moss)" | ||
], | ||
"dependencies": { | ||
"js-yaml": "3.0.1", | ||
"lcov-parse": "0.0.6", | ||
"log-driver": "1.2.4", | ||
"request": "2.74.0", | ||
"minimist": "1.2.0" | ||
"js-yaml": "3.6.1", | ||
"lcov-parse": "0.0.10", | ||
"log-driver": "1.2.5", | ||
"minimist": "1.2.0", | ||
"request": "2.73.0" | ||
}, | ||
"devDependencies": { | ||
"sinon-restore": "1.0.0", | ||
"mocha-lcov-reporter": "0.0.1", | ||
"mocha": "1.8.1", | ||
"should": "1.1.0", | ||
"istanbul": "0.2.10", | ||
"jshint": "2.1.3" | ||
"istanbul": "0.4.4", | ||
"jshint": "2.9.3", | ||
"mocha": "2.5.3", | ||
"mocha-lcov-reporter": "1.2.0", | ||
"should": "9.0.2", | ||
"sinon-restore": "1.0.1", | ||
"snyk": "1.17.0" | ||
}, | ||
@@ -49,0 +51,0 @@ "engines": { |
#node-coveralls | ||
[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Codeship Build Status][codeship-image]][codeship-url] | ||
[![Known Vulnerabilities](https://snyk.io/test/github/nickmerwin/node-coveralls/badge.svg)](https://snyk.io/test/github/nickmerwin/node-coveralls) | ||
@@ -5,0 +6,0 @@ [Coveralls.io](https://coveralls.io/) support for node.js. Get the great coverage reporting of coveralls.io and add a cool coverage button ( like the one above ) to your README. |
@@ -78,4 +78,8 @@ var convertLcovToCoveralls = require('../index').convertLcovToCoveralls; | ||
var originalExistsSync = fs.existsSync; | ||
fs.existsSync = function () { return true; }; | ||
convertLcovToCoveralls(input, {filepath: libpath}, function(err, output){ | ||
fs.readFileSync = originalReadFileSync; | ||
fs.existsSync = originalExistsSync; | ||
@@ -87,2 +91,32 @@ should.not.exist(err); | ||
}); | ||
it ("should ignore files that do not exists", function(done){ | ||
process.env.TRAVIS_JOB_ID = -1; | ||
var lcovpath = __dirname + "/../fixtures/istanbul.lcov"; | ||
var input = fs.readFileSync(lcovpath, "utf8"); | ||
var libpath = "/Users/deepsweet/Dropbox/projects/svgo/lib"; | ||
var sourcepath = path.resolve(libpath, "svgo/config.js"); | ||
var originalReadFileSync = fs.readFileSync; | ||
fs.readFileSync = function(filepath) { | ||
if (filepath === sourcepath) { | ||
return ''; | ||
} | ||
return originalReadFileSync.apply(fs, arguments); | ||
}; | ||
var originalExistsSync = fs.existsSync; | ||
fs.existsSync = function () { return false; }; | ||
convertLcovToCoveralls(input, {filepath: libpath}, function(err, output){ | ||
fs.readFileSync = originalReadFileSync; | ||
fs.existsSync = originalExistsSync; | ||
should.not.exist(err); | ||
output.source_files.should.be.empty(); | ||
done(); | ||
}); | ||
}); | ||
}); |
@@ -101,3 +101,3 @@ var should = require('should'); | ||
}, function(err, str){ | ||
str.branch.should.be.a("string"); | ||
str.branch.should.be.String(); | ||
fetchGitData({ | ||
@@ -109,3 +109,3 @@ "head": { | ||
}, function(err, str){ | ||
str.branch.should.be.a("string"); | ||
str.branch.should.be.String(); | ||
done(); | ||
@@ -173,7 +173,7 @@ }); | ||
options = options.git; | ||
options.head.should.be.a("object"); | ||
options.head.should.be.Object(); | ||
options.head.author_name.should.not.equal("Unknown Author"); | ||
options.head.committer_name.should.not.equal("Unknown Committer"); | ||
options.head.message.should.not.equal("Unknown Commit Message"); | ||
options.branch.should.be.a("string"); | ||
options.branch.should.be.String(); | ||
options.should.have.property("remotes"); | ||
@@ -180,0 +180,0 @@ options.remotes.should.be.instanceof(Array); |
@@ -147,2 +147,5 @@ var should = require('should'); | ||
}); | ||
it ("should set service_name and service_job_id if it's running via Surf", function(done){ | ||
testSurf(getOptions, done); | ||
}); | ||
it ("should override set options with user options", function(done){ | ||
@@ -207,3 +210,3 @@ var userOptions = {service_name: 'OVERRIDDEN_SERVICE_NAME'}; | ||
else | ||
options.git.should.not.have.property('branch'); | ||
options.git.should.not.have.key('branch'); | ||
localGit.wrapUp(); | ||
@@ -343,2 +346,5 @@ done(); | ||
process.env.CI_BRANCH = "master"; | ||
process.env.CI_COMMITTER_NAME = "John Doe"; | ||
process.env.CI_COMMITTER_EMAIL = "jd@example.com"; | ||
process.env.CI_COMMIT_MESSAGE = "adadadadadadadadadad"; | ||
sut(function(err, options){ | ||
@@ -351,5 +357,5 @@ options.service_name.should.equal("codeship"); | ||
author_email: '', | ||
committer_name: 'Unknown Committer', | ||
committer_email: '', | ||
message: 'Unknown Commit Message' }, | ||
committer_name: 'John Doe', | ||
committer_email: 'jd@example.com', | ||
message: 'adadadadadadadadadad' }, | ||
branch: 'master', | ||
@@ -425,2 +431,22 @@ remotes: [] }); | ||
var testSurf = function(sut, done) { | ||
process.env.CI_NAME = 'surf'; | ||
process.env.SURF_SHA1 = "e3e3e3e3e3e3e3e3e"; | ||
process.env.SURF_REF = "feature"; | ||
sut(function(err, options){ | ||
options.service_name.should.equal("surf"); | ||
options.git.should.eql({ head: | ||
{ id: 'e3e3e3e3e3e3e3e3e', | ||
author_name: 'Unknown Author', | ||
author_email: '', | ||
committer_name: 'Unknown Committer', | ||
committer_email: '', | ||
message: 'Unknown Commit Message' }, | ||
branch: 'feature', | ||
remotes: [] }); | ||
done(); | ||
}); | ||
}; | ||
function ensureLocalGitContext(options) { | ||
@@ -427,0 +453,0 @@ var path = require('path'); |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
65649
24
1570
157
7
137
+ Addedargparse@1.0.10(transitive)
+ Addedesprima@2.7.3(transitive)
+ Addedjs-yaml@3.6.1(transitive)
+ Addedlcov-parse@0.0.10(transitive)
+ Addedlog-driver@1.2.5(transitive)
+ Addedrequest@2.73.0(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedtough-cookie@2.2.2(transitive)
- Removedargparse@0.1.16(transitive)
- Removedesprima@1.0.4(transitive)
- Removedjs-yaml@3.0.1(transitive)
- Removedlcov-parse@0.0.6(transitive)
- Removedlog-driver@1.2.4(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedrequest@2.74.0(transitive)
- Removedtough-cookie@2.3.4(transitive)
- Removedunderscore@1.7.0(transitive)
- Removedunderscore.string@2.4.0(transitive)
Updatedjs-yaml@3.6.1
Updatedlcov-parse@0.0.10
Updatedlog-driver@1.2.5
Updatedrequest@2.73.0