karma.conf.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var baseConfig = require('../../../tests/karma-browsers.config')
  2. module.exports = function (config) {
  3. 'use strict';
  4. config.set({
  5. basePath: '../../',
  6. captureTimeout: 3e5,
  7. browserNoActivityTimeout: 3e5,
  8. browserDisconnectTimeout: 3e5,
  9. browserDisconnectTolerance: 3,
  10. concurrency: 1,
  11. urlRoot: '/karma/',
  12. frameworks: ['mocha', 'chai', 'sinon'],
  13. files: [
  14. './tests/validation/index.css',
  15. './tests/validation/integration.js',
  16. './tests/build/test.js',
  17. './tests/validation/validation.js',
  18. { pattern: './tests/**/*', watched: false, included: false, served: true },
  19. { pattern: './dist/assets/**/*', watched: false, included: false, served: true },
  20. ],
  21. proxies: {
  22. '/tests/': '/base/tests/',
  23. '/dist/assets/': '/base/dist/assets/'
  24. },
  25. port: 3000,
  26. colors: true,
  27. autoWatch: false,
  28. singleRun: false,
  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: 'ViewerValidationTests.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
  44. suite: 'Viewer Validation 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. };