karma.conf.js 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. { pattern: 'dist/ammo.js', watched: false }, // need ammo for physics test
  14. '!./**/*.d.ts',
  15. './Tools/DevLoader/BabylonLoader.js',
  16. './tests/unit/babylon/babylon.example.tests.js',
  17. './tests/unit/babylon/serializers/babylon.glTFSerializer.tests.js',
  18. './tests/unit/babylon/src/babylon.node.tests.js',
  19. './tests/unit/babylon/src/Animations/babylon.animation.tests.js',
  20. './tests/unit/babylon/src/Animations/babylon.animationGroup.tests.js',
  21. './tests/unit/babylon/src/Cameras/babylon.pointerInput.tests.js',
  22. './tests/unit/babylon/src/Culling/babylon.ray.tests.js',
  23. './tests/unit/babylon/src/Loading/babylon.sceneLoader.tests.js',
  24. './tests/unit/babylon/src/PostProcesses/babylon.postProcess.tests.js',
  25. './tests/unit/babylon/src/Materials/babylon.material.tests.js',
  26. './tests/unit/babylon/src/Materials/babylon.fresnelParameters.tests.js',
  27. './tests/unit/babylon/src/Meshes/babylon.dictionaryMode.tests.js',
  28. './tests/unit/babylon/src/Meshes/babylon.geometry.tests.js',
  29. './tests/unit/babylon/src/Meshes/babylon.mesh.vertexData.tests.js',
  30. './tests/unit/babylon/src/Meshes/babylon.positionAndRotation.tests.js',
  31. './tests/unit/babylon/src/Misc/babylon.promise.tests.js',
  32. './tests/unit/babylon/src/Physics/babylon.physicsComponents.tests.js',
  33. { pattern: 'dist/preview release/**/*.js', watched: false, included: false, served: true },
  34. { pattern: 'assets/**/*', watched: false, included: false, served: true },
  35. //{ pattern: 'tests/**/*', watched: false, included: false, served: true },
  36. { pattern: 'Playground/scenes/**/*', watched: false, included: false, served: true },
  37. { pattern: 'Playground/textures/**/*', watched: false, included: false, served: true },
  38. { pattern: 'Playground/sounds/**/*', watched: false, included: false, served: true },
  39. { pattern: 'Tools/Config/config.json', watched: false, included: false, served: true },
  40. ],
  41. proxies: {
  42. '/': '/base/'
  43. },
  44. port: 3000,
  45. colors: true,
  46. autoWatch: false,
  47. singleRun: false,
  48. // level of logging
  49. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  50. logLevel: config.LOG_INFO,
  51. reporters: ['progress', 'junit'],
  52. plugins: [
  53. 'karma-mocha',
  54. 'karma-chai',
  55. 'karma-sinon',
  56. 'karma-chrome-launcher',
  57. 'karma-firefox-launcher',
  58. require('../../Tools/Gulp/helpers/gulp-karmaJunitPlugin')
  59. ],
  60. junitReporter: {
  61. outputDir: '.temp/testResults', // results will be saved as $outputDir/$browserName.xml
  62. outputFile: 'UnitTests.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
  63. suite: 'Unit Tests', // suite will become the package name attribute in xml testsuite element
  64. useBrowserName: false, // add browser name to report and classes names
  65. nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
  66. classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
  67. properties: {} // key value pair of properties to add to the <properties> section of the report
  68. },
  69. ...baseConfig
  70. })
  71. }