karma.conf.js 3.9 KB

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