gruntjs / grunt-contrib-nodeunit

Run Nodeunit unit tests.
http://gruntjs.com/
MIT License
70 stars 27 forks source link

Add nodeunit executable on bin folder #15

Closed piranna closed 10 years ago

piranna commented 10 years ago

When including the grunt-contrib-nodeunit devDependency on my project package.json file, when doing npm install I expected to find on node_modules/.bin a symbolic link to the nodeunit executable since it's a dependency of grunt-contrib-nodeunit, but instead I found that this symbolic link is put on node_modules/grunt-contrib-nodeunit/node_modules/.bin instead. I don't think it's a bad idea that path, but I believe it should be added a symbolic link directly on node_modules/.bin so it will be easier to execute without needing to set nodeunit as a direct dependency of my project nor installing them globally.

As proposed on https://github.com/isaacs/npm/issues/4165#issuecomment-28897851, it would be easy to achieve setting on grunt-contrib-nodeunit package.json file the next entry:

bin: { nodeunit: "node_modules/.bin/nodeunit" }
shama commented 10 years ago

If you need nodeunit as a direct dependency to your project then I recommend installing nodeunit as a dependency. Modules shouldn't expose their child dependencies, those dependencies belong to the project, not the consumer.