karma.conf.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Karma configuration
  2. // Generated on Thu Sep 04 2014 07:41:43 GMT-0400 (EDT)
  3. module.exports = function (config) {
  4. config.set({
  5. // base path that will be used to resolve all patterns (eg. files, exclude)
  6. basePath: '',
  7. // frameworks to use
  8. // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
  9. frameworks: ['qunit'],
  10. // list of files / patterns to load in the browser
  11. files: [
  12. 'node_modules/jquery/dist/jquery.min.js',
  13. 'build/toastr.css',
  14. 'toastr.js',
  15. 'node_modules/qunitjs/qunit/qunit.js',
  16. 'tests/unit/qunit-helper.js',
  17. 'tests/unit/toastr-tests.js'
  18. ],
  19. // list of files to exclude
  20. exclude: [],
  21. // preprocess matching files before serving them to the browser
  22. // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
  23. preprocessors: {
  24. 'toastr.js': 'coverage'
  25. },
  26. // test results reporter to use
  27. // possible values: 'dots', 'progress'
  28. // available reporters: https://npmjs.org/browse/keyword/karma-reporter
  29. reporters: ['progress', 'coverage'],
  30. coverageReporter: {
  31. type: 'lcov',
  32. dir: 'tests/coverage'
  33. },
  34. // web server port
  35. port: 9876,
  36. // enable / disable colors in the output (reporters and logs)
  37. colors: true,
  38. // level of logging
  39. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  40. logLevel: config.LOG_INFO,
  41. // enable / disable watching file and executing tests whenever any file changes
  42. autoWatch: false,
  43. // start these browsers
  44. // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
  45. browsers: ['PhantomJS'],
  46. // Continuous Integration mode
  47. // if true, Karma captures browsers, runs the tests and exits
  48. singleRun: true
  49. });
  50. };