@@ -48,7 +48,8 @@ test('when short option listed in short used as flag then long option stored as
48
48
t . end ( ) ;
49
49
} ) ;
50
50
51
- test ( 'when short option listed in short and long listed in `type: "string"` and used with value then long option stored as value' , ( t ) => {
51
+ test ( 'when short option listed in short and long listed in `type: "string"` and ' +
52
+ 'used with value then long option stored as value' , ( t ) => {
52
53
const passedArgs = [ '-f' , 'bar' ] ;
53
54
const passedOptions = { foo : { short : 'f' , type : 'string' } } ;
54
55
const expected = { values : { foo : 'bar' } , positionals : [ ] } ;
@@ -127,7 +128,7 @@ test('Everything after a bare `--` is considered a positional argument', (t) =>
127
128
const expected = { values : { } , positionals : [ 'barepositionals' , 'mopositionals' ] } ;
128
129
const args = parseArgs ( { args : passedArgs } ) ;
129
130
130
- t . deepEqual ( args , expected , 'testing bare positionals' ) ;
131
+ t . deepEqual ( args , expected , Error ( 'testing bare positionals' ) ) ;
131
132
132
133
t . end ( ) ;
133
134
} ) ;
@@ -137,7 +138,7 @@ test('args are true', (t) => {
137
138
const expected = { values : { foo : true , bar : true } , positionals : [ ] } ;
138
139
const args = parseArgs ( { args : passedArgs } ) ;
139
140
140
- t . deepEqual ( args , expected , 'args are true' ) ;
141
+ t . deepEqual ( args , expected , Error ( 'args are true' ) ) ;
141
142
142
143
t . end ( ) ;
143
144
} ) ;
@@ -147,7 +148,7 @@ test('arg is true and positional is identified', (t) => {
147
148
const expected = { values : { foo : true } , positionals : [ 'b' ] } ;
148
149
const args = parseArgs ( { args : passedArgs } ) ;
149
150
150
- t . deepEqual ( args , expected , 'arg is true and positional is identified' ) ;
151
+ t . deepEqual ( args , expected , Error ( 'arg is true and positional is identified' ) ) ;
151
152
152
153
t . end ( ) ;
153
154
} ) ;
@@ -158,7 +159,7 @@ test('args equals are passed `type: "string"`', (t) => {
158
159
const expected = { values : { so : 'wat' } , positionals : [ ] } ;
159
160
const args = parseArgs ( { args : passedArgs , options : passedOptions } ) ;
160
161
161
- t . deepEqual ( args , expected , 'arg value is passed' ) ;
162
+ t . deepEqual ( args , expected , Error ( 'arg value is passed' ) ) ;
162
163
163
164
t . end ( ) ;
164
165
} ) ;
@@ -179,7 +180,7 @@ test('zero config args equals are parsed as if `type: "string"`', (t) => {
179
180
const expected = { values : { so : 'wat' } , positionals : [ ] } ;
180
181
const args = parseArgs ( { args : passedArgs , options : passedOptions } ) ;
181
182
182
- t . deepEqual ( args , expected , 'arg value is passed' ) ;
183
+ t . deepEqual ( args , expected , Error ( 'arg value is passed' ) ) ;
183
184
184
185
t . end ( ) ;
185
186
} ) ;
@@ -190,7 +191,7 @@ test('same arg is passed twice `type: "string"` and last value is recorded', (t)
190
191
const expected = { values : { foo : 'b' } , positionals : [ ] } ;
191
192
const args = parseArgs ( { args : passedArgs , options : passedOptions } ) ;
192
193
193
- t . deepEqual ( args , expected , 'last arg value is passed' ) ;
194
+ t . deepEqual ( args , expected , Error ( 'last arg value is passed' ) ) ;
194
195
195
196
t . end ( ) ;
196
197
} ) ;
@@ -201,7 +202,7 @@ test('args equals pass string including more equals', (t) => {
201
202
const expected = { values : { so : 'wat=bing' } , positionals : [ ] } ;
202
203
const args = parseArgs ( { args : passedArgs , options : passedOptions } ) ;
203
204
204
- t . deepEqual ( args , expected , 'arg value is passed' ) ;
205
+ t . deepEqual ( args , expected , Error ( 'arg value is passed' ) ) ;
205
206
206
207
t . end ( ) ;
207
208
} ) ;
@@ -212,7 +213,7 @@ test('first arg passed for `type: "string"` and "multiple" is in array', (t) =>
212
213
const expected = { values : { foo : [ 'a' ] } , positionals : [ ] } ;
213
214
const args = parseArgs ( { args : passedArgs , options : passedOptions } ) ;
214
215
215
- t . deepEqual ( args , expected , 'first multiple in array' ) ;
216
+ t . deepEqual ( args , expected , Error ( 'first multiple in array' ) ) ;
216
217
217
218
t . end ( ) ;
218
219
} ) ;
@@ -228,7 +229,7 @@ test('args are passed `type: "string"` and "multiple"', (t) => {
228
229
const expected = { values : { foo : [ 'a' , 'b' ] } , positionals : [ ] } ;
229
230
const args = parseArgs ( { args : passedArgs , options : passedOptions } ) ;
230
231
231
- t . deepEqual ( args , expected , 'both arg values are passed' ) ;
232
+ t . deepEqual ( args , expected , Error ( 'both arg values are passed' ) ) ;
232
233
233
234
t . end ( ) ;
234
235
} ) ;
@@ -255,8 +256,8 @@ test('order of option and positional does not matter (per README)', (t) => {
255
256
const passedOptions = { foo : { type : 'string' } } ;
256
257
const expected = { values : { foo : 'bar' } , positionals : [ 'baz' ] } ;
257
258
258
- t . deepEqual ( parseArgs ( { args : passedArgs1 , options : passedOptions } ) , expected , 'option then positional' ) ;
259
- t . deepEqual ( parseArgs ( { args : passedArgs2 , options : passedOptions } ) , expected , 'positional then option' ) ;
259
+ t . deepEqual ( parseArgs ( { args : passedArgs1 , options : passedOptions } ) , expected , Error ( 'option then positional' ) ) ;
260
+ t . deepEqual ( parseArgs ( { args : passedArgs2 , options : passedOptions } ) , expected , Error ( 'positional then option' ) ) ;
260
261
261
262
t . end ( ) ;
262
263
} ) ;
@@ -351,7 +352,7 @@ test('excess leading dashes on options are retained', (t) => {
351
352
} ;
352
353
const result = parseArgs ( { args : passedArgs , options : passedOptions } ) ;
353
354
354
- t . deepEqual ( result , expected , 'excess option dashes are retained' ) ;
355
+ t . deepEqual ( result , expected , Error ( 'excess option dashes are retained' ) ) ;
355
356
356
357
t . end ( ) ;
357
358
} ) ;
0 commit comments