summaryrefslogtreecommitdiff
path: root/web-ui/karma.conf.js
blob: 6a4463fef4668244b9b6ba5bf44c71d1c143c71f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Karma configuration
//
// For all available config options and default values, see:
// http://karma-runner.github.io/0.10/config/configuration-file.html

module.exports = function (config) {
  'use strict';

  config.set({

    // base path, that will be used to resolve files and exclude
    basePath: '',

    // frameworks to use
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      // loaded without require
      'app/bower_components/es5-shim/es5-shim.js',
      'app/bower_components/es5-shim/es5-sham.js',
      'app/bower_components/lodash/dist/lodash.js',
      'app/bower_components/jquery/dist/jquery.js',
      'app/bower_components/jasmine-jquery/lib/jasmine-jquery.js',
      'app/bower_components/jasmine-flight/lib/jasmine-flight.js',
      'app/bower_components/jasmine-jquery/lib/jasmine-jquery.js',
      'app/bower_components/handlebars/handlebars.min.js',
      'app//bower_components/modernizr/modernizr.js',
      'app/bower_components/foundation/js/foundation.js',
      'app/bower_components/foundation/js/foundation/foundation.reveal.js',
      'app/bower_components/foundation/js/foundation/foundation.offcanvas.js',

      // hack to load RequireJS after the shim libs
      'node_modules/requirejs/require.js',
      'node_modules/karma-requirejs/lib/adapter.js',

      // loaded with require
      {pattern: 'app/bower_components/flight/**/*.js', included: false},
      {pattern: 'app/bower_components/i18next/**/*.js', included: false},
      {pattern: 'app/bower_components/quoted-printable/*.js', included: false},
      {pattern: 'app/locales/**/*.json', included: false},
      {pattern: 'app/js/**/*.js', included: false},
      {pattern: 'test/test_data.js', included: false},
      {pattern: 'test/spec/**/*.spec.js', included: false},

      'test/test-main.js'
    ],

    // list of files to exclude
    exclude: [
      'app/js/main.js'
    ],

    // test results reporter to use
    // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
    reporters: ['progress'],

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: [
      'PhantomJS'
    ],

    // If browser does not capture in given timeout [ms], kill it
    captureTimeout: 5000,

    // Continuous Integration mode
    // if true, it capture browsers, run tests and exit
    singleRun: false,

    // Karma will report all the tests that are slower than given time limit (in
    // ms).
    reportSlowerThan: 500,

  });
};