@@ -10,12 +10,14 @@ var path = require('path')
10
10
describe ( 'yargs-parser' , function ( ) {
11
11
it ( 'should parse a "short boolean"' , function ( ) {
12
12
var parse = parser ( [ '-b' ] )
13
+ parse . should . not . have . property ( '--' )
13
14
parse . should . have . property ( 'b' ) . to . be . ok . and . be . a ( 'boolean' )
14
15
parse . should . have . property ( '_' ) . with . length ( 0 )
15
16
} )
16
17
17
18
it ( 'should parse a "long boolean"' , function ( ) {
18
19
var parse = parser ( '--bool' )
20
+ parse . should . not . have . property ( '--' )
19
21
parse . should . have . property ( 'bool' , true )
20
22
parse . should . have . property ( '_' ) . with . length ( 0 )
21
23
} )
@@ -113,6 +115,16 @@ describe('yargs-parser', function () {
113
115
parse . should . have . property ( '_' ) . and . deep . equal ( [ 'bare' , '--not-a-flag' , '-' , '-h' , '-multi' , '--' , 'eek' ] )
114
116
} )
115
117
118
+ it ( 'should not populate "--" if parsing was not stopped' , function ( ) {
119
+ var parse = parser ( [ '-b' ] )
120
+ parse . should . not . have . property ( '--' )
121
+ } )
122
+
123
+ it ( 'should populate "--" if parsing is stopped' , function ( ) {
124
+ var parse = parser ( [ '-b' , '--' , 'foo bar' ] )
125
+ parse . should . have . property ( '--' )
126
+ } )
127
+
116
128
it ( 'should parse numbers appropriately' , function ( ) {
117
129
var argv = parser ( [
118
130
'-x' , '1234' ,
0 commit comments