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'),
4242 */
4343module . exports = function ( options ) {
4444 options = options || { } ;
45+ var docOptions = {
46+ github : ! ! ( options . github || options . g )
47+ } ;
4548 var files = [ ] ;
4649 options . format = options . format || 'html' ;
4750 var formatter = documentation . formats [ options . format ] ;
@@ -54,7 +57,7 @@ module.exports = function (options) {
5457 } , function ( cb ) {
5558 documentation ( files . map ( function ( file ) {
5659 return file . path ;
57- } ) , { } , function ( err , comments ) {
60+ } ) , docOptions , function ( err , comments ) {
5861 formatter ( comments , { } , function ( err , output ) {
5962 if ( options . format === 'json' || options . format === 'md' ) {
6063 this . push ( new File ( {
Original file line number Diff line number Diff line change 1313 "gulp" : " ^3.8.11" ,
1414 "concat-stream" : " ^1.4.8" ,
1515 "prova" : " ^2.1.1" ,
16+ "proxyquire" : " ^1.7.3" ,
1617 "tape" : " ^3.5.0"
1718 },
1819 "keywords" : [
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ var test = require('prova'),
22 path = require ( 'path' ) ,
33 concat = require ( 'concat-stream' ) ,
44 gulp = require ( 'gulp' ) ,
5+ proxyquire = require ( 'proxyquire' ) ,
56 documentation = require ( '../' ) ;
67
78test ( 'gulp-documentation' , function ( t ) {
@@ -45,6 +46,24 @@ test('gulp-documentation html', function(t) {
4546 } ) ) ;
4647} ) ;
4748
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+
4867test ( 'gulp-documentation exit callback' , function ( t ) {
4968 t . plan ( 1 ) ;
5069 gulp . src ( path . join ( __dirname , '/fixture.js' ) )
You can’t perform that action at this time.
0 commit comments