marcopeg / grunt-mocha-chai-sinon

Simple test runner task for NodeJS
8 stars 3 forks source link

Configuration key mocha-chai-sinon is not usable in interpolation of values in Gruntfile. #8

Open bcowgill opened 8 years ago

bcowgill commented 8 years ago

Usually in a gruntfile you can re-use config settings with <%%> quoting but it seems since this package uses a config key with dashes instead of underscores you cannot do that.

See the example below. I would have put a referendce to mocha-chai-sinon.test.src in the mocha_istanbul.coverage.src except that doesn't work with '<%= mocha-chai-sinon.test.src %>' the - is evaluated as a subtraction when trying to interpolate the config setting into the string.

Suggested resolution: look for your configuration within mocha_chai_sinon key in addition to mocha-chai-sinon so that normal interpolation will work.

'mocha-chai-sinon': { test: { src: '<%= mocha_istanbul.coverage.src %>' } },

mocha_istanbul: { coverageUrl: '<%= mocha_istanbul.coverage.options.coverageFolder %>/index.html', coverage: { src: ['<%= jshint.test.src %>', '<%= jshint.test.spec %>'], } }

bcowgill commented 8 years ago

I had a quick attempt at changing the code myself but it didn't work. I fear you'd have to change completely to underscores everywhere to make it work.