Skip to content

Commit ea2a90b

Browse files
committed
Flush callback called. Closes #3.
1 parent bed2d6d commit ea2a90b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function (options) {
3434
return through2.obj(function document(file, enc, cb) {
3535
files.push(file);
3636
cb();
37-
}, function () {
37+
}, function (cb) {
3838
var that = this;
3939
documentation(files.map(function(file) {
4040
return file.path;
@@ -53,6 +53,6 @@ module.exports = function (options) {
5353
} else {
5454
console.error('unknown type detected');
5555
}
56-
}));
56+
}).on('finish', function() { cb(); } ));
5757
});
5858
};

test/test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,13 @@ test('gulp-documentation md custom name', function(t) {
2525
t.end();
2626
});
2727
});
28+
29+
test('gulp-documentation exit callback', function(t) {
30+
t.plan(1);
31+
gulp.src(path.join(__dirname, '/fixture.js'))
32+
.pipe(documentation({ format: 'md' }))
33+
.on('end', function() { t.pass(); })
34+
.resume();
35+
36+
});
37+

0 commit comments

Comments
 (0)