karma.conf.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. module.exports = function(config) {
  2. var configuration = {
  3. frameworks: ['jasmine'],
  4. mime: {
  5. 'application/wasm': ['wasm'],
  6. },
  7. files: [
  8. // Angular core
  9. 'node_modules/angular/angular.js',
  10. 'node_modules/angular-aria/angular-aria.min.js',
  11. 'node_modules/angular-animate/angular-animate.min.js',
  12. 'node_modules/angular-sanitize/angular-sanitize.min.js',
  13. 'node_modules/angular-route/angular-route.min.js',
  14. 'node_modules/angular-material/angular-material.min.js',
  15. 'node_modules/angular-translate/dist/angular-translate.min.js',
  16. // Angular mocking
  17. 'node_modules/angular-mocks/angular-mocks.js',
  18. // SaltyRTC
  19. 'node_modules/@saltyrtc/chunked-dc/dist/chunked-dc.es5.js',
  20. // App bundles
  21. 'dist/generated/app_noinit.bundle.js',
  22. 'dist/generated/unittest_karma.bundle.js',
  23. {pattern: 'dist/generated/[0-9].*.bundle.js', included: false, serve: true},
  24. {pattern: 'dist/generated/*.module.wasm', included: false, serve: true, type: 'wasm'},
  25. // Tests
  26. 'tests/init.js',
  27. 'tests/filters.js',
  28. 'tests/service/message.js',
  29. 'tests/service/mime.js',
  30. 'tests/service/qrcode.js',
  31. 'tests/service/uri.js',
  32. 'tests/service/string.js',
  33. 'tests/service/browser.js',
  34. 'tests/service/keystore.js',
  35. 'tests/service/log.js',
  36. 'tests/service/notification.js',
  37. 'tests/service/receiver.js',
  38. ],
  39. proxies: {
  40. // Also serve all generated files on the root.
  41. // This is required for the .wasm modules.
  42. '/dist/generated/': '/base/dist/generated/',
  43. },
  44. customLaunchers: {
  45. Chromium_ci_gitlab: {
  46. base: 'Chromium',
  47. flags: ['--no-sandbox'],
  48. },
  49. Chrome_ci_circle: {
  50. base: 'Chrome',
  51. flags: ['--no-sandbox'],
  52. },
  53. }
  54. };
  55. if (process.env.GITLAB_CI) {
  56. configuration.browsers = ['Chromium_ci_gitlab', 'Firefox'];
  57. } else if (process.env.CIRCLECI) {
  58. configuration.browsers = ['Chrome_ci_circle', 'Firefox'];
  59. } else {
  60. configuration.browsers = ['Chromium', 'Firefox'];
  61. }
  62. config.set(configuration);
  63. };