New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-codecov

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-codecov - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

.prettierrc

9

gulpfile.js

@@ -1,7 +0,4 @@

var gulp = require('gulp')
var codecov = require('./index.js')
const gulp = require('gulp')
const codecov = require('./index.js')
gulp.task('codecov', function () {
return gulp.src('./coverage/lcov.info')
.pipe(codecov())
})
gulp.task('codecov', () => gulp.src('./coverage/lcov.info').pipe(codecov()))
'use strict'
var through = require('through2')
var gutil = require('gulp-util')
var codecov = require('codecov')
const through = require('through2')
const gutil = require('gulp-util')
const codecov = require('codecov')
var PLUGIN_NAME = 'gulp-codecov'
const PLUGIN_NAME = 'gulp-codecov'
module.exports = function (opts) {
return through.obj(function (file, enc, callback) {
function sendToCodecov (path, done) {
var options = opts || {}
module.exports = opts =>
through.obj(function(file, enc, callback) {
const sendToCodecov = (path, done) => {
const options = opts || {}
options.file = path
codecov.handleInput.upload({
options: options
}, function () {
return done(null, file)
}, function (err) {
return done(new gutil.PluginError(PLUGIN_NAME, err))
})
codecov.handleInput.upload(
{ options },
() => done(null, file),
err => done(new gutil.PluginError(PLUGIN_NAME, err))
)
}

@@ -28,3 +26,6 @@

if (file.isStream()) {
this.emit('error', new gutil.PluginError(PLUGIN_NAME, 'Stream content is not supported'))
this.emit(
'error',
new gutil.PluginError(PLUGIN_NAME, 'Stream content is not supported')
)
return callback()

@@ -38,2 +39,1 @@ }

})
}
{
"name": "gulp-codecov",
"version": "3.0.1",
"version": "3.0.2",
"description": "Gulp plugin to submit code coverage to Codecov",

@@ -26,7 +26,8 @@ "keywords": [

"scripts": {
"test": "standard && istanbul cover ./node_modules/mocha/bin/_mocha --report lcov -- -R spec",
"precommit": "lint-staged",
"test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcov -- -R spec",
"codecov": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && gulp codecov && rm -rf ./coverage"
},
"dependencies": {
"codecov": "^2.1.0",
"codecov": "^3.0.0",
"gulp-util": "^3.0.8",

@@ -37,10 +38,12 @@ "path": "^0.12.7",

"devDependencies": {
"chai": "^3.5.0",
"chai": "^4.0.2",
"event-stream": "^3.3.4",
"gulp": "^3.9.1",
"husky": "0.14.3",
"istanbul": "^0.4.5",
"mocha": "^3.3.0",
"lint-staged": "7.2.0",
"mocha": "^5.2.0",
"mocha-lcov-reporter": "^1.3.0",
"sinon": "^2.2.0",
"standard": "^10.0.2"
"prettier": "1.13.5",
"sinon": "6.0.0"
},

@@ -51,3 +54,13 @@ "engines": {

},
"license": "MIT"
"license": "MIT",
"lint-staged": {
"**/*.js": [
"prettier --write",
"git add"
],
"*.js": [
"prettier --write",
"git add"
]
}
}

@@ -1,5 +0,7 @@

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency Status][depstat-image]][depstat-url] [![Dev Dependency Status][devdepstat-image]][devdepstat-url] [![npm Downloads][downloads-image]][npm-url]
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency Status][depstat-image]][depstat-url] [![Dev Dependency Status][devdepstat-image]][devdepstat-url] [![npm Downloads][downloads-image]][npm-url] [![code style: prettier][prettier-image]][prettier-url]
# gulp-codecov
[![Greenkeeper badge](https://badges.greenkeeper.io/eddiemoore/gulp-codecov.svg)](https://greenkeeper.io/)
[Gulp](https://github.com/wearefractal/gulp) plugin to submit code coverage to [Codecov.io](http://codecov.io).

@@ -18,6 +20,5 @@

```javascript
var codecov = require('gulp-codecov');
var codecov = require('gulp-codecov')
gulp.src('./coverage/lcov.info')
.pipe(codecov());
gulp.src('./coverage/lcov.info').pipe(codecov())
```

@@ -31,15 +32,12 @@

[npm-image]: https://img.shields.io/npm/v/gulp-codecov.svg?style=flat-square
[travis-url]: http://travis-ci.org/eddiemoore/gulp-codecov
[travis-image]: https://img.shields.io/travis/eddiemoore/gulp-codecov/master.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eddiemoore/gulp-codecov
[codecov-image]: https://img.shields.io/codecov/c/github/eddiemoore/gulp-codecov/master.svg?style=flat-square
[depstat-url]: https://david-dm.org/eddiemoore/gulp-codecov
[depstat-image]: https://img.shields.io/david/eddiemoore/gulp-codecov/master.svg?style=flat-square
[devdepstat-url]: https://david-dm.org/eddiemoore/gulp-codecov#info=devDependencies
[devdepstat-image]: https://img.shields.io/david/dev/eddiemoore/gulp-codecov/master.svg?style=flat-square
[downloads-image]: https://img.shields.io/npm/dt/gulp-codecov.svg?maxAge=2592000&style=flat-square
[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
[prettier-url]: https://github.com/prettier/prettier
/* global describe, it, beforeEach, afterEach */
'use strict'
var expect = require('chai').expect
var fs = require('fs')
var es = require('event-stream')
var gutil = require('gulp-util')
var sinon = require('sinon')
var codecov = require('codecov')
var gulpCodecov = require('../')
const expect = require('chai').expect
const fs = require('fs')
const es = require('event-stream')
const gutil = require('gulp-util')
const sinon = require('sinon')
const codecov = require('codecov')
const gulpCodecov = require('../')
describe('gulp-codecov', function () {
describe('gulp-codecov', () => {
process.env.TRAVIS = 'true'

@@ -20,13 +20,13 @@ process.env.TRAVIS_JOB_ID = '1234'

describe('success', function () {
beforeEach(function () {
describe('success', () => {
beforeEach(() => {
sinon.stub(codecov.handleInput, 'upload').callsArgWith(1, 'success')
})
afterEach(function () {
afterEach(() => {
codecov.handleInput.upload.restore && codecov.handleInput.upload.restore()
})
it('should pass the file through via buffer', function (done) {
var srcFile = new gutil.File({
it('should pass the file through via buffer', done => {
const srcFile = new gutil.File({
base: 'test/fixtures',

@@ -38,5 +38,5 @@ cwd: 'test/',

var stream = gulpCodecov()
const stream = gulpCodecov()
stream.once('error', function (err) {
stream.once('error', err => {
expect(err).to.exist // eslint-disable-line

@@ -46,6 +46,8 @@ done(err)

stream.once('data', function (newFile) {
stream.once('data', newFile => {
expect(newFile).to.exist // eslint-disable-line
expect(newFile.contents).to.exist // eslint-disable-line
expect(String(newFile.contents)).to.equal(fs.readFileSync('test/expected/lcov.info', 'utf8'))
expect(String(newFile.contents)).to.equal(
fs.readFileSync('test/expected/lcov.info', 'utf8')
)
done()

@@ -58,4 +60,4 @@ })

it('should send the file contents to Codecov', function (done) {
var srcFile = new gutil.File({
it('should send the file contents to Codecov', done => {
const srcFile = new gutil.File({
path: 'test/fixtures/lcov.info',

@@ -67,13 +69,18 @@ cwd: 'test/',

var stream = gulpCodecov()
const stream = gulpCodecov()
stream.write(srcFile)
stream.end()
stream.once('data', function () {
stream.once('data', () => {
sinon.assert.calledOnce(codecov.handleInput.upload)
sinon.assert.calledWith(codecov.handleInput.upload, {
options: {
file: 'test/fixtures/lcov.info'
}
}, sinon.match.func, sinon.match.func)
sinon.assert.calledWith(
codecov.handleInput.upload,
{
options: {
file: 'test/fixtures/lcov.info'
}
},
sinon.match.func,
sinon.match.func
)
done()

@@ -84,4 +91,4 @@ })

describe('when Codecov responds with an error', function () {
beforeEach(function () {
describe('when Codecov responds with an error', () => {
beforeEach(() => {
sinon.stub(codecov.handleInput, 'upload').callsArgWith(2, {

@@ -94,8 +101,8 @@ stack: 'err',

afterEach(function () {
afterEach(() => {
codecov.handleInput.upload.restore && codecov.handleInput.upload.restore()
})
it('should emit an error', function (done) {
var srcFile = new gutil.File({
it('should emit an error', done => {
const srcFile = new gutil.File({
path: 'test/fixtures/lcov.info',

@@ -107,5 +114,5 @@ cwd: 'test/',

var stream = gulpCodecov()
const stream = gulpCodecov()
stream.once('error', function (error) {
stream.once('error', error => {
expect(error).to.exist // eslint-disable-line

@@ -120,17 +127,17 @@ done()

describe('nulls', function () {
beforeEach(function () {
describe('nulls', () => {
beforeEach(() => {
sinon.stub(codecov.handleInput, 'upload')
})
afterEach(function () {
afterEach(() => {
codecov.handleInput.upload.restore && codecov.handleInput.upload.restore()
})
it('should pass the file through when null', function (done) {
var nullFile = new gutil.File()
it('should pass the file through when null', done => {
const nullFile = new gutil.File()
var stream = gulpCodecov()
const stream = gulpCodecov()
stream.once('data', function (newFile) {
stream.once('data', newFile => {
expect(newFile).to.exist // eslint-disable-line

@@ -146,5 +153,5 @@ sinon.assert.notCalled(codecov.handleInput.upload)

describe('streams', function () {
it('should error on stream', function (done) {
var srcFile = new gutil.File({
describe('streams', () => {
it('should error on stream', done => {
const srcFile = new gutil.File({
path: 'test/fixtures/lcov.info',

@@ -156,5 +163,5 @@ cwd: 'test/',

var stream = gulpCodecov()
const stream = gulpCodecov()
stream.on('error', function (err) {
stream.on('error', err => {
expect(err).to.exist // eslint-disable-line

@@ -164,6 +171,8 @@ done()

stream.on('data', function (newFile) {
newFile.contents.pipe(es.wait(function (err, data) {
done(err)
}))
stream.on('data', newFile => {
newFile.contents.pipe(
es.wait((err, data) => {
done(err)
})
)
})

@@ -170,0 +179,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc