karma.conf.js 2.1 KB

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