@@ -8,7 +8,7 @@ const { expect } = chai;
8
8
const fs = require ( 'fs' ) ;
9
9
10
10
describe ( 'command line interface' , ( ) => {
11
- it ( 'help menu works' , ( done ) => {
11
+ it ( 'help menu works' , done => {
12
12
const helpCommand = `${ process . env . PWD } /bin/swagger-jsdoc.js -h` ;
13
13
exec ( helpCommand , ( error , stdout , stderr ) => {
14
14
if ( error ) {
@@ -19,7 +19,7 @@ describe('command line interface', () => {
19
19
} ) ;
20
20
} ) ;
21
21
22
- it ( 'help menu is default fallback when no arguments' , ( done ) => {
22
+ it ( 'help menu is default fallback when no arguments' , done => {
23
23
const helpCommand = `${ process . env . PWD } /bin/swagger-jsdoc.js` ;
24
24
exec ( helpCommand , ( error , stdout , stderr ) => {
25
25
if ( error ) {
@@ -30,7 +30,7 @@ describe('command line interface', () => {
30
30
} ) ;
31
31
} ) ;
32
32
33
- it ( 'should require a definition file' , ( done ) => {
33
+ it ( 'should require a definition file' , done => {
34
34
const wrongDefinition = `${ process . env . PWD } /bin/swagger-jsdoc.js wrongDefinition` ;
35
35
exec ( wrongDefinition , ( error , stdout , stderr ) => {
36
36
if ( error ) {
@@ -41,7 +41,7 @@ describe('command line interface', () => {
41
41
} ) ;
42
42
} ) ;
43
43
44
- it ( 'should require an info object in the definition' , ( done ) => {
44
+ it ( 'should require an info object in the definition' , done => {
45
45
const wrongDefinition = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/v2/empty_definition.js` ;
46
46
exec ( wrongDefinition , ( error , stdout , stderr ) => {
47
47
if ( error ) {
@@ -54,7 +54,7 @@ describe('command line interface', () => {
54
54
} ) ;
55
55
} ) ;
56
56
57
- it ( 'should require title and version in the info object' , ( done ) => {
57
+ it ( 'should require title and version in the info object' , done => {
58
58
const wrongDefinition = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/v2/wrong_definition.js` ;
59
59
exec ( wrongDefinition , ( error , stdout , stderr ) => {
60
60
if ( error ) {
@@ -67,7 +67,7 @@ describe('command line interface', () => {
67
67
} ) ;
68
68
} ) ;
69
69
70
- it ( 'should require arguments with jsDoc data about an API' , ( done ) => {
70
+ it ( 'should require arguments with jsDoc data about an API' , done => {
71
71
const missingApis = `${ process . env . PWD } /bin/swagger-jsdoc.js -d example/v2/swaggerDef.js` ;
72
72
exec ( missingApis , ( error , stdout , stderr ) => {
73
73
if ( error ) {
@@ -80,7 +80,7 @@ describe('command line interface', () => {
80
80
} ) ;
81
81
} ) ;
82
82
83
- it ( 'should create swagger.json by default when the API input is good' , ( done ) => {
83
+ it ( 'should create swagger.json by default when the API input is good' , done => {
84
84
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d example/v2/swaggerDef.js example/v2/routes.js` ;
85
85
exec ( goodInput , ( error , stdout , stderr ) => {
86
86
if ( error ) {
@@ -97,7 +97,7 @@ describe('command line interface', () => {
97
97
} ) ;
98
98
} ) ;
99
99
100
- it ( 'should create swagger.json by default when the API input is from definition file' , ( done ) => {
100
+ it ( 'should create swagger.json by default when the API input is from definition file' , done => {
101
101
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/v2/api_definition.js` ;
102
102
exec ( goodInput , ( error , stdout , stderr ) => {
103
103
if ( error ) {
@@ -114,7 +114,7 @@ describe('command line interface', () => {
114
114
} ) ;
115
115
} ) ;
116
116
117
- it ( 'should accept custom configuration for output specification' , ( done ) => {
117
+ it ( 'should accept custom configuration for output specification' , done => {
118
118
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d example/v2/swaggerDef.js -o customSpec.json example/v2/routes.js` ;
119
119
exec ( goodInput , ( error , stdout , stderr ) => {
120
120
if ( error ) {
@@ -128,7 +128,7 @@ describe('command line interface', () => {
128
128
} ) ;
129
129
} ) ;
130
130
131
- it ( 'should create a YAML swagger spec when a custom output configuration with a .yaml extension is used' , ( done ) => {
131
+ it ( 'should create a YAML swagger spec when a custom output configuration with a .yaml extension is used' , done => {
132
132
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d example/v2/swaggerDef.js -o customSpec.yaml example/v2/routes.js` ;
133
133
exec ( goodInput , ( error , stdout , stderr ) => {
134
134
if ( error ) {
@@ -142,7 +142,7 @@ describe('command line interface', () => {
142
142
} ) ;
143
143
} ) ;
144
144
145
- it ( 'should create a YAML swagger spec when a custom output configuration with a .yml extension is used' , ( done ) => {
145
+ it ( 'should create a YAML swagger spec when a custom output configuration with a .yml extension is used' , done => {
146
146
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d example/v2/swaggerDef.js -o customSpec.yml example/v2/routes.js` ;
147
147
exec ( goodInput , ( error , stdout , stderr ) => {
148
148
if ( error ) {
@@ -156,7 +156,7 @@ describe('command line interface', () => {
156
156
} ) ;
157
157
} ) ;
158
158
159
- it ( 'should allow a JavaScript definition file' , ( done ) => {
159
+ it ( 'should allow a JavaScript definition file' , done => {
160
160
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/v2/api_definition.js` ;
161
161
exec ( goodInput , ( error , stdout , stderr ) => {
162
162
if ( error ) {
@@ -167,7 +167,7 @@ describe('command line interface', () => {
167
167
} ) ;
168
168
} ) ;
169
169
170
- it ( 'should allow a JSON definition file' , ( done ) => {
170
+ it ( 'should allow a JSON definition file' , done => {
171
171
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/api_definition.json` ;
172
172
exec ( goodInput , ( error , stdout , stderr ) => {
173
173
if ( error ) {
@@ -178,7 +178,7 @@ describe('command line interface', () => {
178
178
} ) ;
179
179
} ) ;
180
180
181
- it ( 'should allow a YAML definition file' , ( done ) => {
181
+ it ( 'should allow a YAML definition file' , done => {
182
182
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/api_definition.yaml` ;
183
183
exec ( goodInput , ( error , stdout , stderr ) => {
184
184
if ( error ) {
@@ -189,15 +189,15 @@ describe('command line interface', () => {
189
189
} ) ;
190
190
} ) ;
191
191
192
- it ( 'should reject definition file with invalid YAML syntax' , ( done ) => {
192
+ it ( 'should reject definition file with invalid YAML syntax' , done => {
193
193
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/wrong_syntax.yaml` ;
194
194
exec ( goodInput , ( error , stdout ) => {
195
195
expect ( stdout ) . to . contain ( 'tag suffix cannot contain exclamation marks' ) ;
196
196
done ( ) ;
197
197
} ) ;
198
198
} ) ;
199
199
200
- it ( 'should reject definition file with non-JSON compatible YAML syntax' , ( done ) => {
200
+ it ( 'should reject definition file with non-JSON compatible YAML syntax' , done => {
201
201
const goodInput = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/non_json_compatible.yaml` ;
202
202
exec ( goodInput , ( error , stdout ) => {
203
203
expect ( stdout ) . to . contain (
@@ -207,23 +207,23 @@ describe('command line interface', () => {
207
207
} ) ;
208
208
} ) ;
209
209
210
- it ( 'should reject definition file with invalid JSON syntax' , ( done ) => {
210
+ it ( 'should reject definition file with invalid JSON syntax' , done => {
211
211
const input = `${ process . env . PWD } /bin/swagger-jsdoc.js -d test/fixtures/wrong_syntax.json` ;
212
212
exec ( input , ( error , stdout ) => {
213
213
expect ( stdout ) . to . contain ( 'Unexpected token t in JSON' ) ;
214
214
done ( ) ;
215
215
} ) ;
216
216
} ) ;
217
217
218
- it ( 'should reject bad YAML identation with feedback: upper line' , ( done ) => {
218
+ it ( 'should reject bad YAML identation with feedback: upper line' , done => {
219
219
const input = `${ process . env . PWD } /bin/swagger-jsdoc.js -d example/v2/swaggerDef.js test/fixtures/wrong-yaml-identation1.js` ;
220
220
exec ( input , ( error , stdout , stderr ) => {
221
221
expect ( stderr ) . to . contain ( 'Pay attention at this place' ) ;
222
222
done ( ) ;
223
223
} ) ;
224
224
} ) ;
225
225
226
- it ( 'should reject bad YAML identation with feedback: same line' , ( done ) => {
226
+ it ( 'should reject bad YAML identation with feedback: same line' , done => {
227
227
const input = `${ process . env . PWD } /bin/swagger-jsdoc.js -d example/v2/swaggerDef.js test/fixtures/wrong-yaml-identation2.js` ;
228
228
exec ( input , ( error , stdout , stderr ) => {
229
229
expect ( stderr ) . to . contain ( 'Pay attention at this place' ) ;
0 commit comments