File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ var through2 = require('through2'),
42
42
*/
43
43
module . exports = function ( options ) {
44
44
options = options || { } ;
45
+ var docOptions = {
46
+ github : ! ! ( options . github || options . g )
47
+ } ;
45
48
var files = [ ] ;
46
49
options . format = options . format || 'html' ;
47
50
var formatter = documentation . formats [ options . format ] ;
@@ -54,7 +57,7 @@ module.exports = function (options) {
54
57
} , function ( cb ) {
55
58
documentation ( files . map ( function ( file ) {
56
59
return file . path ;
57
- } ) , { } , function ( err , comments ) {
60
+ } ) , docOptions , function ( err , comments ) {
58
61
formatter ( comments , { } , function ( err , output ) {
59
62
if ( options . format === 'json' || options . format === 'md' ) {
60
63
this . push ( new File ( {
Original file line number Diff line number Diff line change 13
13
"gulp" : " ^3.8.11" ,
14
14
"concat-stream" : " ^1.4.8" ,
15
15
"prova" : " ^2.1.1" ,
16
+ "proxyquire" : " ^1.7.3" ,
16
17
"tape" : " ^3.5.0"
17
18
},
18
19
"keywords" : [
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ var test = require('prova'),
2
2
path = require ( 'path' ) ,
3
3
concat = require ( 'concat-stream' ) ,
4
4
gulp = require ( 'gulp' ) ,
5
+ proxyquire = require ( 'proxyquire' ) ,
5
6
documentation = require ( '../' ) ;
6
7
7
8
test ( 'gulp-documentation' , function ( t ) {
@@ -45,6 +46,24 @@ test('gulp-documentation html', function(t) {
45
46
} ) ) ;
46
47
} ) ;
47
48
49
+ test ( 'gulp-documentation github links' , function ( t ) {
50
+ var through2Stub = {
51
+ obj : function ( indexes , callback ) {
52
+ callback . call ( ) ;
53
+ }
54
+ } ,
55
+ documentationStub = function ( indexes , options ) {
56
+ t . equal ( options . github , true ) ;
57
+ t . end ( ) ;
58
+ } ,
59
+ documentationjs = proxyquire ( '../' , {
60
+ 'through2' : through2Stub ,
61
+ 'documentation' : documentationStub
62
+ } ) ;
63
+
64
+ documentationjs ( { format : 'html' , github : true } ) ;
65
+ } ) ;
66
+
48
67
test ( 'gulp-documentation exit callback' , function ( t ) {
49
68
t . plan ( 1 ) ;
50
69
gulp . src ( path . join ( __dirname , '/fixture.js' ) )
You can’t perform that action at this time.
0 commit comments