gulp-codacy
Version:
[](https://travis-ci.org/MrBoolean/gulp-codacy) [](https://www.codacy.com/app/mrboolean/gulp-codacy
42 lines (37 loc) • 969 B
JavaScript
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)
;
});
});