Skip to content

Commit 556cd6b

Browse files
committed
Ignore test-manual, update tests
1 parent 3846024 commit 556cd6b

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
html-documentation
2+
test-manual

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ var File = require('vinyl');
7373
* });
7474
*/
7575
module.exports = function (format, options, formatterOptions) {
76+
options = options || {};
77+
formatterOptions = formatterOptions || {};
7678
var files = [];
7779
format = format || 'md';
7880
var formatter = documentation.formats[format];
@@ -89,7 +91,7 @@ module.exports = function (format, options, formatterOptions) {
8991
formatter(comments, formatterOptions, function (err, output) {
9092
if (format === 'json' || format === 'md') {
9193
this.push(new File({
92-
path: options.filename || 'API.' + options.format,
94+
path: options.filename || 'API.' + format,
9395
contents: new Buffer(output)
9496
}));
9597
} else if (format === 'html') {

test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('gulp-documentation', function(t) {
1111

1212
test('gulp-documentation md', function(t) {
1313
gulp.src(path.join(__dirname, '/fixture.js'))
14-
.pipe(documentation({ format: 'md' }))
14+
.pipe(documentation('md', {}, {}))
1515
.on('data', function(d) {
1616
t.equal(d.path, 'API.md');
1717
t.end();
@@ -20,7 +20,7 @@ test('gulp-documentation md', function(t) {
2020

2121
test('gulp-documentation md custom name', function(t) {
2222
gulp.src(path.join(__dirname, '/fixture.js'))
23-
.pipe(documentation({ format: 'md', filename: 'foo.md' }))
23+
.pipe(documentation('md', { filename: 'foo.md' }))
2424
.on('data', function(d) {
2525
t.equal(d.path, 'foo.md');
2626
t.end();
@@ -29,7 +29,7 @@ test('gulp-documentation md custom name', function(t) {
2929

3030
test('gulp-documentation json', function(t) {
3131
gulp.src(path.join(__dirname, '/fixture.js'))
32-
.pipe(documentation({ format: 'json' }))
32+
.pipe(documentation('json'))
3333
.on('data', function(d) {
3434
t.ok(JSON.parse(d.contents), 'is json');
3535
t.end();
@@ -38,7 +38,7 @@ test('gulp-documentation json', function(t) {
3838

3939
test('gulp-documentation html', function(t) {
4040
gulp.src(path.join(__dirname, '/fixture.js'))
41-
.pipe(documentation({ format: 'html' }))
41+
.pipe(documentation('html'))
4242
.pipe(concat(function(d) {
4343
t.equal(d.length, 34);
4444
t.end();
@@ -48,7 +48,7 @@ test('gulp-documentation html', function(t) {
4848
test('gulp-documentation exit callback', function(t) {
4949
t.plan(1);
5050
gulp.src(path.join(__dirname, '/fixture.js'))
51-
.pipe(documentation({ format: 'md' }))
51+
.pipe(documentation('md'))
5252
.on('end', function() { t.pass(); })
5353
.resume();
5454
});

0 commit comments

Comments
 (0)