@@ -39,21 +39,23 @@ function normalize(result) {
39
39
return result ;
40
40
}
41
41
42
+ var options = { timeout : 1000 * 30 } ;
43
+
42
44
test ( 'documentation binary' , function ( t ) {
43
45
documentation ( [ 'fixture/simple.input.js' ] , function ( err , data ) {
44
46
t . error ( err ) ;
45
47
t . equal ( data . length , 1 , 'simple has no dependencies' ) ;
46
48
t . end ( ) ;
47
49
} ) ;
48
- } ) ;
50
+ } , options ) ;
49
51
50
52
test ( 'defaults to parsing package.json main' , function ( t ) {
51
53
documentation ( [ ] , { cwd : path . join ( __dirname , '..' ) } , function ( err , data ) {
52
54
t . error ( err ) ;
53
55
t . ok ( data . length , 'we document ourself' ) ;
54
56
t . end ( ) ;
55
57
} ) ;
56
- } ) ;
58
+ } , options ) ;
57
59
58
60
test ( 'accepts config file' , function ( t ) {
59
61
documentation ( [ 'fixture/sorting/input.js -c fixture/config.json' ] ,
@@ -75,22 +77,22 @@ test('accepts config file', function (t) {
75
77
'respected sort order from config file' ) ;
76
78
t . end ( ) ;
77
79
} ) ;
78
- } ) ;
80
+ } , options ) ;
79
81
80
82
test ( '--shallow option' , function ( t ) {
81
83
documentation ( [ '--shallow fixture/internal.input.js' ] , function ( err , data ) {
82
84
t . error ( err ) ;
83
85
t . equal ( data . length , 0 , 'should not check dependencies' ) ;
84
86
t . end ( ) ;
85
87
} ) ;
86
- } ) ;
88
+ } , options ) ;
87
89
88
90
test ( 'bad -f option' , function ( t ) {
89
91
documentation ( [ '-f DOES-NOT-EXIST fixture/internal.input.js' ] , function ( err ) {
90
92
t . ok ( err , 'returns error' ) ;
91
93
t . end ( ) ;
92
94
} ) ;
93
- } ) ;
95
+ } , options ) ;
94
96
95
97
test ( 'html with no destination' , function ( t ) {
96
98
documentation ( [ '-f html fixture/internal.input.js' ] , function ( err ) {
@@ -99,7 +101,7 @@ test('html with no destination', function (t) {
99
101
'needs dest for html' ) ;
100
102
t . end ( ) ;
101
103
} ) ;
102
- } ) ;
104
+ } , options ) ;
103
105
104
106
test ( '--lint option' , function ( t ) {
105
107
documentation ( [ '--lint fixture/lint/lint.input.js' ] , function ( err , data ) {
@@ -112,15 +114,15 @@ test('--lint option', function (t) {
112
114
t . equal ( data , fs . readFileSync ( output , 'utf8' ) , 'outputs lint' ) ;
113
115
t . end ( ) ;
114
116
} ) ;
115
- } ) ;
117
+ } , options ) ;
116
118
117
119
test ( '--lint option on good file' , function ( t ) {
118
120
documentation ( [ '--lint fixture/simple.input.js' ] , { } , function ( err , data ) {
119
121
t . equal ( err , null ) ;
120
122
t . equal ( data , '' , 'no output' ) ;
121
123
t . end ( ) ;
122
124
} , false ) ;
123
- } ) ;
125
+ } , options ) ;
124
126
125
127
test ( 'given no files' , function ( t ) {
126
128
documentation ( [ '' ] , function ( err ) {
@@ -129,7 +131,7 @@ test('given no files', function (t) {
129
131
'no files given' ) ;
130
132
t . end ( ) ;
131
133
} ) ;
132
- } ) ;
134
+ } , options ) ;
133
135
134
136
test ( 'write to file' , function ( t ) {
135
137
@@ -141,7 +143,7 @@ test('write to file', function (t) {
141
143
t . ok ( fs . existsSync ( dst ) , 'created file' ) ;
142
144
t . end ( ) ;
143
145
} , false ) ;
144
- } ) ;
146
+ } , options ) ;
145
147
146
148
test ( 'write to html' , function ( t ) {
147
149
@@ -155,7 +157,7 @@ test('write to html', function (t) {
155
157
t . ok ( fs . existsSync ( path . join ( dstDir , 'index.html' ) ) , 'created index.html' ) ;
156
158
t . end ( ) ;
157
159
} , false ) ;
158
- } ) ;
160
+ } , options ) ;
159
161
160
162
test ( 'fatal error' , function ( t ) {
161
163
@@ -164,4 +166,4 @@ test('fatal error', function (t) {
164
166
t . ok ( err . toString ( ) . match ( / U n e x p e c t e d t o k e n / ) , 'reports syntax error' ) ;
165
167
t . end ( ) ;
166
168
} , false ) ;
167
- } ) ;
169
+ } , options ) ;
0 commit comments