karma.conf.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var baseConfig = require('../../tests/karma-browsers.config')
  2. module.exports = function (config) {
  3. config.set({
  4. basePath: '../',
  5. captureTimeout: 3e5,
  6. browserNoActivityTimeout: 3e5,
  7. browserDisconnectTimeout: 3e5,
  8. browserDisconnectTolerance: 3,
  9. concurrency: 1,
  10. urlRoot: '/karma/',
  11. frameworks: ['mocha', 'chai', 'sinon'],
  12. files: [
  13. './tests/build/*.js',
  14. { pattern: './tests/**/*', watched: false, included: false, served: true },
  15. ],
  16. proxies: {
  17. '/tests/': '/base/tests/'
  18. },
  19. client: {
  20. mocha: {
  21. timeout: 10000
  22. }
  23. },
  24. port: 3000,
  25. colors: true,
  26. autoWatch: false,
  27. singleRun: true,
  28. browserNoActivityTimeout: 20000,
  29. // level of logging
  30. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  31. logLevel: config.LOG_INFO,
  32. reporters: ['progress', 'junit'],
  33. plugins: [
  34. 'karma-mocha',
  35. 'karma-chai',
  36. 'karma-sinon',
  37. 'karma-chrome-launcher',
  38. 'karma-firefox-launcher',
  39. require('../../Tools/Gulp/helpers/gulp-karmaJunitPlugin')
  40. ],
  41. junitReporter: {
  42. outputDir: '../.temp/testResults', // results will be saved as $outputDir/$browserName.xml
  43. outputFile: 'ViewerUnitTests.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
  44. suite: 'Viewer Unit Tests', // suite will become the package name attribute in xml testsuite element
  45. useBrowserName: false, // add browser name to report and classes names
  46. nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
  47. classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
  48. properties: {} // key value pair of properties to add to the <properties> section of the report
  49. },
  50. ...baseConfig
  51. })
  52. }