karma.conf.coffee 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. module.exports = (config) ->
  2. config.set
  3. frameworks: ['mocha', 'requirejs']
  4. files: [
  5. # We do not want any files to execute automatically
  6. {pattern: 'calculator.coffee', included: false}
  7. {pattern: 'test.coffee', included: false}
  8. # Except for this one. This one shall execute.
  9. 'requirejs.karma.coffee'
  10. ]
  11. browsers: ['Firefox']
  12. coffeePreprocessor:
  13. options:
  14. sourceMap: true
  15. preprocessors:
  16. # source files, that you wanna generate coverage for
  17. # do not include tests or libraries
  18. # (these files will be instrumented by Istanbul via Ibrik unless
  19. # specified otherwise in coverageReporter.instrumenter)
  20. 'calculator.coffee': 'coverage'
  21. # note: project files will already be converted to
  22. # JavaScript via coverage preprocessor.
  23. # Thus, you'll have to limit the CoffeeScript preprocessor
  24. # to uncovered files.
  25. 'test.coffee': 'coffee'
  26. 'requirejs.karma.coffee': 'coffee'
  27. coverageReporter:
  28. type: 'text-summary'
  29. useJSExtensionForCoffeeScript: true
  30. instrumenters:
  31. ibrik : require('ibrik')
  32. instrumenter:
  33. '**/*.coffee': 'ibrik'
  34. # coverage reporter generates the coverage
  35. reporters: ['dots', 'coverage']
  36. plugins: [
  37. require('../../lib/index')
  38. 'karma-mocha'
  39. 'karma-requirejs'
  40. 'karma-coffee-preprocessor'
  41. 'karma-firefox-launcher'
  42. ]
  43. singleRun: true