karma.conf.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. module.exports = function (config) {
  2. 'use strict';
  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/validation/index.css',
  14. './tests/validation/integration.js',
  15. './tests/build/test.js',
  16. './tests/validation/validation.js',
  17. { pattern: './tests/**/*', watched: false, included: false, served: true },
  18. { pattern: './dist/assets/**/*', watched: false, included: false, served: true },
  19. ],
  20. proxies: {
  21. '/tests/': '/base/tests/',
  22. '/dist/assets/': '/base/dist/assets/'
  23. },
  24. port: 3000,
  25. colors: true,
  26. autoWatch: false,
  27. singleRun: false,
  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: 'ViewerValidationTests.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
  43. suite: 'Viewer Validation 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: ['Chrome']
  50. });
  51. };