grunt-mocha-cov
grunt-mocha-cov copied to clipboard
Coverage does not follow same code path as tests
We have grunt-mocha-cov configured as follows:
mochacov: {
test: {
options: {
reporter: 'spec',
require: ['should']
},
files: 'tests/**/*.js'
},
coverage: {
options: {
reporter: 'mocha-lcov-reporter',
require: ['should'],
coverage: true,
output: 'rprts/cov.lcov'
},
files: { src: 'tests/**/*.js' }
}
}
we are using hapi, and also using mockery for a couple of tests in specific situations. When using hapi.inject for testing, and mockery at the same time, the unit tests run correctly and use the mock, however the coverage does not use the mock.
Realise this is a very specific situation, but clear that the tests and coverage are running differently. Any assistance or suggestions would be greatly appreciated.