/common/static/karma_common.conf.js

https://gitlab.com/unofficial-mirrors/edx-platform · JavaScript · 76 lines · 57 code · 13 blank · 6 comment · 0 complexity · 67af61b79940d749dbd7015244cf198d MD5 · raw file

  1. // Karma config for common suite.
  2. // Docs and troubleshooting tips in common/static/common/js/karma.common.conf.js
  3. /* eslint-env node */
  4. 'use strict';
  5. var path = require('path');
  6. var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js'));
  7. var options = {
  8. useRequireJs: false,
  9. normalizePathsForCoverageFunc: function(appRoot, pattern) {
  10. return path.join(appRoot, '/common/static/' + pattern);
  11. },
  12. // Avoid adding files to this list. Use RequireJS.
  13. libraryFilesToInclude: [
  14. {pattern: 'coffee/src/ajax_prefix.js', included: true},
  15. {pattern: 'js/vendor/draggabilly.js', included: true},
  16. {pattern: 'common/js/vendor/jquery.js', included: true},
  17. {pattern: 'common/js/vendor/jquery-migrate.js', included: true},
  18. {pattern: 'coffee/src/jquery.immediateDescendents.js', included: true},
  19. {pattern: 'js/vendor/jquery.leanModal.js', included: true},
  20. {pattern: 'js/vendor/jquery.timeago.js', included: true},
  21. {pattern: 'js/vendor/jquery.truncate.js', included: true},
  22. {pattern: 'js/vendor/URI.min.js', included: true},
  23. {pattern: 'js/test/add_ajax_prefix.js', included: true},
  24. {pattern: 'js/test/i18n.js', included: true},
  25. {pattern: 'common/js/vendor/underscore.js', included: true},
  26. {pattern: 'common/js/vendor/underscore.string.js', included: true},
  27. {pattern: 'common/js/vendor/backbone.js', included: true},
  28. {pattern: 'edx-ui-toolkit/js/utils/global-loader.js', included: true},
  29. {pattern: 'edx-ui-toolkit/js/utils/string-utils.js', included: true},
  30. {pattern: 'edx-ui-toolkit/js/utils/html-utils.js', included: true},
  31. {pattern: 'js/vendor/jasmine-imagediff.js', included: true},
  32. {pattern: 'common/js/spec_helpers/jasmine-extensions.js', included: true},
  33. {pattern: 'common/js/spec_helpers/jasmine-waituntil.js', included: true},
  34. {pattern: 'common/js/spec_helpers/discussion_spec_helper.js', included: true},
  35. {pattern: 'common/js/spec/discussion/view/discussion_view_spec_helper.js', included: true}
  36. ],
  37. libraryFiles: [
  38. ],
  39. // Make sure the patterns in sourceFiles and specFiles do not match the same file.
  40. // Otherwise Istanbul which is used for coverage tracking will cause tests to not run.
  41. sourceFiles: [
  42. {pattern: 'coffee/src/**/*.js', included: true},
  43. {pattern: 'common/js/xblock/core.js', included: true},
  44. {pattern: 'common/js/xblock/runtime.v1.js', included: true},
  45. {pattern: 'common/js/discussion/**/*.js', included: true},
  46. {pattern: 'js/capa/src/**/*.js', included: true},
  47. {pattern: 'js/src/**/*.js', included: true}
  48. ],
  49. specFiles: [
  50. {pattern: 'coffee/spec/**/*.js', included: true},
  51. {pattern: 'common/js/spec/xblock/*.js', included: true},
  52. {pattern: 'common/js/spec/discussion/**/*spec.js', included: true},
  53. {pattern: 'js/**/*spec.js', included: true}
  54. ],
  55. fixtureFiles: [
  56. {pattern: 'js/fixtures/**/*.html'},
  57. {pattern: 'js/capa/fixtures/**/*.html'},
  58. {pattern: 'common/templates/**/*.underscore'}
  59. ]
  60. };
  61. module.exports = function(config) {
  62. configModule.configure(config, options);
  63. };