karma.config.ts 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // This file is named differently than its JS bootstrapper to avoid the ts compiler to overwrite it.
  2. import path = require('path');
  3. import { customLaunchers } from './browser-providers.ts';
  4. export function config(config) {
  5. config.set({
  6. basePath: path.join(__dirname, '../..'),
  7. frameworks: ['jasmine'],
  8. plugins: [
  9. require('karma-jasmine'),
  10. require('karma-coverage'),
  11. require('karma-sourcemap-loader'),
  12. require('karma-chrome-launcher'),
  13. require('karma-spec-reporter')
  14. ],
  15. files: [
  16. {pattern: 'dist/vendor/core-js/client/core.js', included: true, watched: false},
  17. {pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false},
  18. {pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false},
  19. {pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false},
  20. {pattern: 'dist/vendor/zone.js/dist/proxy.js', included: true, watched: false},
  21. {pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false},
  22. {pattern: 'dist/vendor/zone.js/dist/fake-async-test.js', included: true, watched: false},
  23. {pattern: 'scripts/karma/system.config.js', included: true, watched: false},
  24. // paths loaded via module imports
  25. {pattern: 'dist/**/*.js', included: false, watched: true},
  26. // paths to support debugging with source maps in dev tools
  27. {pattern: 'dist/**/*.ts', included: false, watched: false},
  28. {pattern: 'dist/**/*.js.map', included: false, watched: false}
  29. ],
  30. proxies: {},
  31. customLaunchers: customLaunchers,
  32. exclude: [
  33. 'dist/e2e/**/*'
  34. ],
  35. // Source files that you wanna generate coverage for.
  36. // Do not include tests or libraries (these files will be instrumented by Istanbul)
  37. preprocessors: {
  38. 'dist/ionic-angular/umd/**/!(*spec).js': ['coverage'],
  39. 'dist/ionic-angular/**/*.js': ['sourcemap']
  40. },
  41. reporters: ['coverage', 'spec'],
  42. specReporter: {
  43. maxLogLines: 5, // limit number of lines logged per test
  44. suppressErrorSummary: true, // do not print error summary
  45. suppressFailed: false, // do not print information about failed tests
  46. suppressPassed: false, // do not print information about passed tests
  47. suppressSkipped: true, // do not print information about skipped tests
  48. showSpecTiming: false // print the time elapsed for each spec
  49. },
  50. port: 9876,
  51. colors: true,
  52. logLevel: config.LOG_INFO,
  53. autoWatch: true,
  54. sauceLabs: {
  55. testName: 'ionic',
  56. startConnect: false,
  57. recordVideo: false,
  58. recordScreenshots: false,
  59. options: {
  60. 'selenium-version': '2.48.2',
  61. 'command-timeout': 600,
  62. 'idle-timeout': 600,
  63. 'max-duration': 5400
  64. }
  65. },
  66. browserStack: {
  67. project: 'ionic',
  68. startTunnel: false,
  69. retryLimit: 1,
  70. timeout: 600,
  71. pollingTimeout: 20000
  72. },
  73. browserDisconnectTimeout: 20000,
  74. browserNoActivityTimeout: 240000,
  75. captureTimeout: 120000,
  76. browsers: ['Chrome_1024x768'],
  77. coverageReporter: {
  78. reporters: [
  79. {type: 'json', subdir: '.', file: 'coverage-final.json'}
  80. ]
  81. },
  82. singleRun: true
  83. });
  84. };