grunt-mocha-cov icon indicating copy to clipboard operation
grunt-mocha-cov copied to clipboard

Coverage does not follow same code path as tests

Open toboid opened this issue 11 years ago • 0 comments

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.

toboid avatar Feb 20 '14 10:02 toboid