firstandthird / load-grunt-config

Grunt plugin that lets you break up your Gruntfile config by task
firstandthird.github.io/load-grunt-config/
MIT License
374 stars 64 forks source link

Alises to functions fail since version 0.11.0 #80

Closed dfernandez79 closed 10 years ago

dfernandez79 commented 10 years ago

For versions <= 0.10.0 it was possible to create an alias to a function. The regression was introduced by https://github.com/firstandthird/load-grunt-config/commit/665ce854afa48540f11e0ff49872af35fd0e1760#diff-d41d8cd98f00b204e9800998ecf8427e

To reproduce, create an alias to a function:

aliases.coffee:

module.exports =
    someAlias: () -> 'Do something'

If you run that alias with grunt, the following message appears:


Running "someAlias" task
Warning: Task "undefined" not found. Use --force to continue.

This PR fixes that regression, and adds a unit test for it. The unit test needs to overwrite the loadGruntConfig mock set at setup to avoid more changes in other tests.

dfernandez79 commented 10 years ago

I just realise that #73 does the same, but with a different approach for the unit tests.

Please consider to merge any of the PRs, this prevents some projects to upgrade from 0.10.

jgallen23 commented 10 years ago

I like the approach to the unit tests. thanks

jgallen23 commented 10 years ago

released as 0.13.1