UNPKG

gulp-codacy

Version:

[![Build Status](https://travis-ci.org/MrBoolean/gulp-codacy.svg)](https://travis-ci.org/MrBoolean/gulp-codacy) [![Codacy Badge](https://api.codacy.com/project/badge/grade/a19a78117de845009832fe9cc432d27e)](https://www.codacy.com/app/mrboolean/gulp-codacy

42 lines (37 loc) 969 B
var codacy = require('../'); var util = require('gulp-util'); var array = require('stream-array'); var File = util.File; function stream(file) { return array([file || new File({ cwd: process.cwd(), base: '/test', path: 'test.lcov', contents: new Buffer('') })]); } describe('gulp-codacy', function gulpCodacyTestSuite() { it('should throw an error if one of the obtained stream files does not exist', function noContent(done) { stream() .pipe(codacy()) .on('error', function expectedError() { done(); }) .on('end', function handleEnd() { done(new Error('Wrong event')); }) ; }); it('should support path with spaces', function withSpaces(done) { var file = new File({ cwd: process.cwd(), path: 'test/coverage-with-spaces.lcov', contents: new Buffer('') }); stream(file) .pipe(codacy()) .on('error', done) .on('end', done) ; }); });