@@ -274,12 +274,45 @@ describe('nodemon respects custom "ext" and "execMap"', function () {
274
274
} ) ;
275
275
} ) ;
276
276
277
- describe ( 'nodemon should slurp properly' , ( ) => {
277
+ describe . only ( 'nodemon should slurp properly' , ( ) => {
278
278
it ( 'should read quotes as a single entity' , ( ) => {
279
279
const settings = parse ( asCLI ( 'notindex.js -- -b "hello - world"' ) ) ;
280
280
assert ( settings . execOptions . exec === 'node' , 'node is exec' ) ;
281
281
assert ( settings . args . length === 3 , 'only has 3 arguments to node' ) ;
282
282
} ) ;
283
+
284
+ it ( 'should pass non-slurped args to script' , ( ) => {
285
+ const settings = parse ( asCLI ( '-- --log' ) ) ;
286
+ var cmd = commandToString ( command ( settings ) ) ;
287
+ assert . equal ( cmd , 'node ./lib/nodemon.js --log' , 'args passed to script' ) ;
288
+ } ) ;
289
+
290
+ it ( 'should pass non-slurped args to explicit script' , ( ) => {
291
+ const settings = parse ( asCLI ( './lib/nodemon.js -- --log' ) ) ;
292
+ var cmd = commandToString ( command ( settings ) ) ;
293
+ assert . equal ( cmd , 'node ./lib/nodemon.js --log' , 'args passed to script' ) ;
294
+ } ) ;
295
+
296
+ it ( 'should pass slurped args to explicit script' , ( ) => {
297
+ const settings = parse ( asCLI ( './lib/nodemon.js --log' ) ) ;
298
+ var cmd = commandToString ( command ( settings ) ) ;
299
+ assert . equal ( cmd , 'node ./lib/nodemon.js --log' , 'args passed to script' ) ;
300
+ } ) ;
301
+
302
+ it ( 'should handle a mix of slurps' , ( ) => {
303
+ var cmd ;
304
+ var settings ;
305
+
306
+ cmd = commandToString ( command ( parse ( asCLI ( '--inspect -- --log' ) ) ) ) ;
307
+ assert . equal ( cmd , 'node --inspect ./lib/nodemon.js --log' , 'args passed to script' ) ;
308
+
309
+ cmd = commandToString ( command ( parse ( asCLI ( '--inspect ./lib/nodemon.js -- --log' ) ) ) ) ;
310
+ assert . equal ( cmd , 'node --inspect ./lib/nodemon.js --log' , 'args passed to script' ) ;
311
+
312
+ cmd = commandToString ( command ( parse ( asCLI ( '--inspect --log ./lib/nodemon.js' ) ) ) ) ;
313
+ assert . equal ( cmd , 'node --inspect --log ./lib/nodemon.js' , 'args passed to script' ) ;
314
+ } ) ;
315
+
283
316
} ) ;
284
317
285
318
describe ( 'nodemon with CoffeeScript' , function ( ) {
0 commit comments