mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
test to demonstrate coffee issue with --args
If you try to run nodemon with a coffee file script and pass an argument to your application, it is instead adding a --nodejs when there are no node flags to pass along. This causes the command to fail because the script name is now passed as a flag to node. Repro: nodemon script.coffee --my-argument Expected: coffee script.coffee --my-argument Actual: coffee --nodejs script.coffee --my-argument Related to #530
This commit is contained in:
@@ -282,6 +282,19 @@ describe('nodemon with CoffeeScript', function () {
|
||||
assert(settings.execOptions.execArgs.indexOf('--nodejs') === -1, 'is not using --nodejs');
|
||||
});
|
||||
|
||||
it('should not add --nodejs with app arguments', function () {
|
||||
var settings = parse(asCLI('test/fixtures/app.coffee --my-app-arg'));
|
||||
assert(settings.execOptions.exec.indexOf('coffee') === 0, 'executable is CoffeeScript');
|
||||
assert(settings.execOptions.execArgs.indexOf('--nodejs') === -1, 'is not using --nodejs');
|
||||
});
|
||||
|
||||
it('groups exec argument into a single --nodejs argument', function () {
|
||||
var settings = parse(asCLI('--harmony --debug test/fixtures/app.coffee'));
|
||||
assert(settings.execOptions.exec.indexOf('coffee') === 0, 'executable is CoffeeScript');
|
||||
assert(settings.execOptions.execArgs[0] === '--nodejs', 'is using --nodejs');
|
||||
assert(settings.execOptions.execArgs[1] === '--harmony --debug', 'is grouping exec arguments');
|
||||
});
|
||||
|
||||
it('should add --nodejs when used with --debug', function () {
|
||||
var settings = parse(asCLI('--debug test/fixtures/app.coffee'));
|
||||
var cmd = commandToString(command(settings));
|
||||
|
||||
Reference in New Issue
Block a user