karma.conf.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. var baseConfig = require('../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/modules/tests-karma.js',
  14. // load the latest build
  15. { pattern: './tests/modules/build/dependencies/**/*.js', watched: false, included: true, served: true },
  16. './tests/modules/build/tests-loader.js',
  17. { pattern: 'assets/**/*', watched: false, included: false, served: true },
  18. { pattern: 'Playground/scenes/**/*', watched: false, included: false, served: true },
  19. { pattern: 'Playground/textures/**/*', watched: false, included: false, served: true },
  20. { pattern: 'Playground/sounds/**/*', watched: false, included: false, served: true }
  21. ],
  22. proxies: {
  23. '/': '/base/'
  24. },
  25. port: 3000,
  26. colors: true,
  27. autoWatch: false,
  28. singleRun: true,
  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: 'ModuleTests.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
  44. suite: 'Module 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. }